/* Write a C Program to print stars Sequence like pyramid 2
*
**
***
****
=========================================== */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
24 C P
S
ROGRAMS WITH
OLUTIONS
{
for(j=5;j>=i;j--)
printf(“ ”);
for(k=1;k<=i;k++)
printf(“*”);
printf(“\n”);
}
getch();
}
Output:
======
*
**
***
****
*****
*
**
***
****
=========================================== */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
24 C P
S
ROGRAMS WITH
OLUTIONS
{
for(j=5;j>=i;j--)
printf(“ ”);
for(k=1;k<=i;k++)
printf(“*”);
printf(“\n”);
}
getch();
}
Output:
======
*
**
***
****
*****
No comments:
Post a Comment