C Program to print a pyramid using *

Wednesday, 20 September 2017


#include<stdio.h>
#include<conio.h>
void main()
{
int i,k,j,n;
clrscr();
printf("Please Enter Size \n");
scanf("%d",&n);
for(i=1;i<=n;i++)
    {
    for(k=n-1;k>=i;k--)
       {
           printf(" ");
       }
     for(j=1;j<=2*i-1;j++)
       {
      printf("*");
      }
   printf("\n");
  }
  getch();
 }




OUTPUT-



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Related Posts Plugin for WordPress, Blogger...
 

Most Reading

Labels