C Number Pattern 13

Last Updated:

C Number Pattern 13

Try to print the following number pattern using C.

Print This Output
12345
4321
123
21
1

Source Code

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

Share this Page

Meet the Author