Advertisement

Display of star

#include <stdio.h>
#include <conio.h>
#include <math.h>
 main ()
{
    int i,j,k;
   
    for(i=1;i<=5;++i) 
    {
                     for(j=5-i;j>=0;j--)
                     printf(" ");
                     for(k=1;k<=i;++k)      
                     printf("* ");
                      printf("\n");                            
     }
      getch();
     return 0;
}

No comments:

Post a Comment

Please comment bellow. Share your knowledge