1. Write program to generate the following patterns using iteration (loop) statements:
54321
5432
543
54
Answers
Answered by
0
Answer:
#include <stdio.h>
#include <conio.h>
int main()
{
int i,j,rows;
printf("Enter the number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows-1; i++){
for(j=rows; j>=i; j--){
printf("%d",j);
}
printf("\n");
}
getch();
return 0;
}
Explanation:
i have written the program in c language . here i used i and j variable where i represent row and j represent column.
Similar questions
Math,
5 months ago
English,
5 months ago
Business Studies,
11 months ago
Math,
1 year ago
Physics,
1 year ago