Print reverse right-angle triangle using FOR loop
#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter the number of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
printf("#", i);
}
printf("\n");
}
}
// i for rows & j for collumns
Comments
Post a Comment