Contact Learn C
Copy Program Share Program

Program 151:Left Symbol Pyramid

Program 151:

Method I
#include<stdio.h>
#include<stdlib.h>
main()
{
    int i,j,k,rows,count,temp;
    printf("Enter number of rows:\n");
    scanf("%d",&rows);
    
    for(i=1;i<=rows;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf("* ");
            
        }
       
        printf("\n");
    }  
 for(i=rows-1;i>=1;i--)
 {
  for(j=i;j>=1;j--)
  {
   printf("* ");
  }
  printf("\n");
 }  
}

Method II 
 
#include<stdio.h>
#include<stdlib.h>
main()
{
    int i,j,k,rows,count,temp;
    printf("Enter number of rows:\n");
    scanf("%d",&rows);
    
    for(i=rows;i>=-rows;i--)
    {
        for(j=rows;j>=abs(i);j--)
        {
            printf("* ");
            
        }
       
        printf("\n");
    }    
}

Explanation:

//Coming Soon...

Output:

Left Symbol Pyramid

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide