Star Pattern in the form of valley

 // *      *

// **    **
// ***  ***
// ********

#include<stdio.h>
int main()
{
    int a,b,c,d,e;
printf("Enter the Number till you want to print the Pattern:\n");
scanf("%d",&a);
for ( b = 0; b < a; b++)
 {
   for(c=0; c<b+1; c++)
    {
        printf("*");
    }
      for(d=0;d<(2*a-2*c); d ++)
        {
            printf(" ");
        }
           for (e=0;e<=b;e++)
           {
               printf("*");
            }
   
    printf("\n");
 }
return 0;
}

Comments

Popular posts from this blog

Maths Unit 1 ( Theory )

Intelligence System notes part 2

code for find the determinant of 3x3 matrix