C Program Pattern25

 #include<stdio.h>

#include<conio.h>


void main()

{

int i, j, no;

clrscr();


printf("Enter number: ");

scanf("%d", &no);


for(i=1; i<=no-1; i++)

{

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

{

printf("%d ", j*5);

}

printf("1 ");

printf("\n");

}

printf("1 ");


getch();

}


/*


Output:


Enter number: 5

20 15 10 5 1

15 10 5 1

10 5 1

5 1

1


*/

No comments:

Post a Comment