Professional Documents
Culture Documents
Output :
* * * * *
* * * * * * * * * *_
Creation Date : 12:43 AM 22/11/2010 Author : www.technoexam.com [Technowell, Sangli] */ #include <stdio.h> #include <conio.h> void main() { int i,j; clrscr(); for(i=0; i<5; i++) { for(j=0; j<=i; j++) { printf(" * "); } printf("\n"); } getch(); } Program to print pyramid in C : Pattern 3 :
Output :
* * * * * * * * * *
* * * * *_
{ for(j=5; j>=i; j--) { printf(" "); } for(k=1; k<=i; k++) { printf("*"); } printf("\n"); } getch(); } Program to print pyramid in C : Pattern 4 :
Output :
* * * * * * * * * *
* * * * *_
Output :
* * * * * * * * * * * * * * *_
Output :
* * * * * * * * * * * * * * *_
Output :
* * * * * * * * *
* * * * * * *
* * * * * * * * *_
{ printf(" "); } for(j=i; j>=1; j--) { printf("*"); } samp = samp + 1; printf("\n"); } getch(); }