C Number Pattern 19

Last Updated:

C Number Pattern 19

Try to print the following number pattern using C.

Print This Output
5 5 5 5 5
4 5 5 5 5
3 4 5 5 5
2 3 4 5 5
1 2 3 4 5

Source Code

C Compiler
#include <stdio.h> int main() { int i, j; for(i=5; i>=1; i--) { for(j=i; j<=5; j++) printf("%d ", j); for(j=1; j<i; j++) printf("%d ", 5); printf("\n"); } return 0; }

Share this Page

Meet the Author