Monday , December 18 2017
Home / C / c program for pattern#6

c program for pattern#6



Also see : Alternate Java program for pattern#6

int main()
int n,i,j;    //  initialize the variables
printf("Enter the number of rows in the pattern : ");
scanf("%d",&n);     // number of rows to be printed.
for(i=1;i<=n;i++)    // loop for number of rows in pyramid
for(j=1;j<=n-i;j++)     //  loop for spaces
printf(" ");   // printing the space
for(j=1;j<=i;j++)  // loop for  printing  the stars at 1st part of triangle
for(j=1;j<i;j++)   // loop for printing the 2nd triangle
printf("\n");    // next line
return 1;


output for patternstar#6

Also See:   c program for pattern#14

Check Also

How to Solve Linear Equation in One Variable In C Programming?

C Program to Solve any Linear Equation in One Variable Find complete C program to ...

Leave a Reply

Your email address will not be published. Required fields are marked *