Problem
create a c language program to generate following pattern on the console (screen) using for loop.*
* *
* * *
* * * *
* * * * *
Solution - Code
#include<stdio.h>int main()
{
int i,j;
i=1;
j=1;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
system("pause");
return 0;
}
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.