Print Reverse Star Pattern Using For Loops
Answer:
#include<stdio.h>
int main()
{ int n;
scanf("%d", &n);
for (int i = 0; i <= n-1; i++)
{
for (int j = 0; j <= n-i-1; j++)
{
printf("* ");
}
printf("\n");
}
return 0;
}
Now just enter the number of rows you want to print and check the result. Thank you
Comments
Post a Comment