C Program – Print fun with pyramid

by Nideesh C on May 9, 2011 · 0 comments

in C Programming




//Downloaded From theonlinetutorials.com
#include"stdio.h"
#include<conio.h>

void main()
{
int a;
int i,j,k;
clrscr();
printf(" Enter an integer value: ");
scanf("%d",&a);
for(i=0;i<=2*a+1;i++)
printf("*");
printf("\n");
for(i=1;i<=a-1;i++)
{
for(j=a;j>=i;j--)
printf("*");
printf(" ");
for(j=a;j>=i;j--)
printf("*");
printf("\n");
}
printf("*Theonlinetutorials.com \n");
for(i=2;i<=a;i++)
{
for(j=1;j<=i;j++)
printf("*");
printf(" ");
for(j=1;j<=i;j++)
printf("*");
printf("\n");
}
for(i=0;i<=2*a+1;i++)
printf("*");
getch();
}



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C Program – Print the number which are not occurred in Fibonacci Series
  2. C program to generate and print prime numbers in a given range. Also print the number of prime numbers
  3. C program to generate and print first N FIBONACCI numbers
  4. C Program – Implement the midpoint circle drawing algorithm
  5. C program to find the value of sin(x) using the series up to the given accuracy (without using user defined function) Also print sin(x) using library function.

Leave a Comment

Previous post:

Next post: