Print Pattern #2 in C

Source Code

/*
4321
432
43
4
*/

#include <stdio.h>
//#include <conio.h>

void main () {
	int i, j, n=4;
	//clrscr();

	for (i=1; i<=n; i++) {
		for (j=n; j>=i; j--)
			printf("%d", j);
		printf("\n");
	}

	//getch();
}

Output

4321
432
43
4

Leave a Reply

Note: Your email address will not be published. Required fields are marked *