Wednesday, 5 October 2011

to print * pyramid using while loop


#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
i=1;
while(i<=5)
{
printf("\n");
i++;
j=1;
while(j<=i)
{
printf("*");
j++;
}
}
getch();
return 0;
}

No comments:

Post a Comment