0% found this document useful (0 votes)
304 views1 page

Pyramid C

This C program asks the user to input the number of rows for a triangle pattern. It then uses nested for loops to print out that number of rows, with each row containing one more asterisk than the previous row, printing a triangle pattern of ascending asterisks. After completing the pattern, it waits for the user to press a key before ending.

Uploaded by

kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
304 views1 page

Pyramid C

This C program asks the user to input the number of rows for a triangle pattern. It then uses nested for loops to print out that number of rows, with each row containing one more asterisk than the previous row, printing a triangle pattern of ascending asterisks. After completing the pattern, it waits for the user to press a key before ending.

Uploaded by

kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <stdio.

h>
void main()
{
int n, c, k;
printf("Enter number of rows\n");
scanf("%d",&n);
for ( c = 1 ; c <= n ; c++ )
{
for( k = 1 ; k <= c ; k++ )
printf("*");
printf("\n");
}
getch();
}

You might also like