Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

newline used incorrectly

$
0
0
hey friends, i need to display the folloing pattern using C:
*****-----
*****-----
*****-----
----------
----------
----------
instead of getting this output , im getting:
*****
*****
*****
-----
-----
-----
----------
----------
----------


here is my source code:
[b]main()
{
   int i,j,n,l,m,o,k;
     for(j=1;j<=3;j++)
        {
            for(i=1;i<=5;i++)
            {
                printf("*");
            }
                printf("\n");
        }
        for(l=1;l<=3;l++)
        {
            for(m=1;m<=5;m++)
            {
                printf("-");
            }
            printf("\n");
        }
   
    for(n=1;n<=3;n++)
    {
        for(o=1;o<=10;o++)[b]
        {
            printf("-");
        }
            printf("\n");
    }
}[/b]



what changes do i need to make in my program?? thanks in advance

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>