Thursday, July 30, 2009

Can you give me the syntax code in C programming where in the output is a TRIANGLE using asterisk(*).?

I really need a sample program in C programming where in the output to be displayed is a TRIANGLE using asterisk(*). This Program must use a "LOOP STATEMENT".Please help me about this matter. Thank you.

Can you give me the syntax code in C programming where in the output is a TRIANGLE using asterisk(*).?
int i,.j,n,n1,a;


main()


{


printf("enter any no it sholud be an odd no\t");


scanf("%d",%26amp;n);


a=1;


n1=++n/2;


for(j=0;j%26lt;n;j++)


{


for(i=0;i%26lt;n1;i++)


{


printf(" \t");


}


for(j=0;j%26lt;a;j++)


printf("*");
Reply:for(i=1;i%26lt;10;i++)


{


for(j=i-1;j%26lt;i;j++)


{


print(*);


}


}


No comments:

Post a Comment