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



#include<stdio.h>

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

Output

Output - Reverse Half Pyramid Pattern






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.