Saved Bookmarks
| 1. |
Print the following pattern in c program5 4 3 2 14 3 2 13 2 1211Sample testcasesInput 1Output 15Enter the number of rows:5 4 2 14 3 2 13 2 12 11 |
Answer» Answer:This is the required C program for the question. #include int main () { int i,j,n; PRINTF("Enter number of rows - "); scanf("%d",&n); printf("Here is your pattern.\n"); for(i=n;i>=1;i--) { for(j=i;j>=1;j--) printf("%d ",j); printf("\n"); } return 0; } ALGORITHM:
See the attachment for output ☑. |
|