ADVERTISEMENT
ADVERTISEMENT

Home » C programs

C program for 'Full Pyramid' Pattern

In this C program, we are going to learn how to print a Full pyramid. Here, we are reading total number of rows and printing the Full pyramid accordingly.
Submitted by Shamikh Faraz, on February 14, 2018

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

C program



#include<stdio.h>
int main()
{
	int a,b,c,l=1,rows;
	
	printf("Enter number of rows\t");
	scanf("%d",&rows);
	
	for(a=1; a<=rows; a++)
	{
		for(b=10; b>=a; b--)
		{
			printf(" ");
		}

		for(c=1; c<=l; c++)
		{ 
			printf("*");
		}            
		l = l+2;    
		printf("\n");
	}
	
	return 0;
}

Output

Output - Full pyramid program in C

ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

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.