C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs

Home » C programs

C program for 'Reverse Half Pyramid' Pattern

In this C program, we are implementing logic to print Reverse Half Pyramid pattern using asterisks and loops (nested loops).
Submitted by Shamikh Faraz, on February 16, 2018

In this program, we will learn, how we can print reverse half pyramid using ‘asterisks’ and ‘loops’.

C program


int main ()
	int a,b,rows;  
	printf("Enter number of rows \t");
	//decreases the number of rows
	for (a=rows;a>=1;a--)  
		//prints star in increasing order   
		for (b=1;b<=a;b++) 
			printf("* ");  
	return 0;


Output - Reverse Half Pyramid Pattern

Liked this article? Do share with your friends :)

Are you a blogger? Join our Blogging forum.