Write a nested FOR loop (using two for loops & two fprintf statements to generate the following pattern:
*****
****
***
**
*
Hi, Please find my implementation.
Please let me know in case of any issue.
#include <stdio.h>
int main(){
int n;
printf("How many rows ? ");
scanf("%d", &n);
int i, j;
for(i=1; i<=n; i++){
for(j=i; j<=n; j++){
fprintf(stdout,
"%c", '*');
}
fprintf(stdout, "\n");
}
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.