Problem è Print the as stars as the inputted numbers.

 

Answer è       

 

/* wap to  print as stars as the inputted number*/

#include <stdio.h>

main( )

{

int i,a,j;

clrscr ( );

printf ("\nHow many stars you want to see?\n\t\tenter the number of stars.");

scanf ("%d", &a);

for (i=1; i<=a; i++)

{

printf ("\n%d", i);

for (j=0; j<i; j++)

printf ("\t*");

}

getch ( );

return 0;

}

INPUT

OUTPUT

 

A=4

*

* *

* * *

* * * * *