C Program Pattern9

 #include<stdio.h>

#include<conio.h>


void main()

{

int i, j, no;

clrscr();


printf("Enter number: ");

scanf("%d", &no);


for(i=no; i>=1; i--)

{

for(j=i; j<=no; j++)

{

printf("%d ", j);

}

printf("\n");

}


getch();

}


/*


Output:


Enter number: 5

5

4 5

3 4 5

2 3 4 5

1 2 3 4 5


*/

No comments:

Post a Comment