To print star using C programming like
*
**
***
****
*****
just copy the bellow code and paste it to your TurboC software. And then run the program.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,rows;
clrscr();
printf("enter number of rows : ");
scanf("%d",&rows);
for(i=1;i<=rows;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
0 comments:
Post a Comment