Click on read more
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,r;
clrscr();
printf("Enter the no. Of rows:");
scanf("%d",&r);
for(i=1;i<=r;i++){
for(j=1;j<=r;j++){
if(j<=r-i)
printf(" ");
else
printf("*");
}
printf("\n");
}
getch();
}
Output:
Enter the no. Of rows:5
    *
   **
  ***
 ****
*****
 
 
 
Great
ReplyDeleteHelpful
ReplyDelete