Write a program to print descending number pattern in C-language using for-loop

Write a program to print number pattern below in C-language

9 8 7 6 5 4 3 2 1

9 8 7 6 5 4 3 2

9 8 7 6 5 4 3

9 8 7 6 5 4

9 8 7 6 5

9 8 7 6

9 8 7

9 8

9


#include<stdio.h>

int main(int argc, char** argv) {

int i,j,n;

printf("Enter a number: ");

scanf("%d",&n);

for(i=1;i<=n;i++){

for(j=n;j>=i;j--){

printf("%d ",j);

}

printf("\n");

}

return 0;

}



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.