Problem Description
·
Pyramid
Star Formation
CODING
ARENA::
#include <stdio.h>
int main()
{
int n,i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
printf("*");
printf("\n");
}
return
0;
}
·
Test Case 1
Input (stdin)
5
Expected
Output
*
**
***
****
*****
·
Test Case 2
Input (stdin)
3
Expected Output
*
**
***
FOR FURTHER CLASSIFICATIONS CONTACT US.
ReplyDeleteHelpful bro
ReplyDeleteWITH PLEASURE
Deleteint i, j, rows;
ReplyDeleteprintf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
printf("%d ",j);
}
printf("\n");
}
Program for pyramid of numbers
DeleteProgram for pyramid of number
ReplyDeleteint i, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
printf("%d ",j);
}
printf("\n");
}