Thursday, July 30, 2009

Turbo c problem....?

can anyone help me with this (it's my final exam actually)?





printed output:





enter the number of levels in the pyramid : 3 (user input)





*


* *


* * *





much thanks!

Turbo c problem....?
for( int i=1; i%26lt; 4; i++)


{


for( int j=0; j%26lt; i; j++ )


printf("*");


}





// enjoy ur final
Reply:printf("enter the number of levels in the pyramid: ");


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





for (int inc=0;inc %26lt; input;inc++)


{


for (int inc2 = inc;inc2 %26gt;= 0;inc2--)


{printf("*");}


printf("\n");


}





Relish the Final!


No comments:

Post a Comment