CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,p,s;
clrscr();
for(i=1;i<=5;i++)
{
p=i;
for(s=1;s<=6-i;s++)
{
printf(" "); /* three spaces */
}
for(j=1;j<=(2*i-1);j++)
{
printf(" *"); /* two spaces */
}
printf("\n\n");
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,p,s;
clrscr();
for(i=1;i<=5;i++)
{
p=i;
for(s=1;s<=6-i;s++)
{
printf(" "); /* three spaces */
}
for(j=1;j<=(2*i-1);j++)
{
printf(" *"); /* two spaces */
}
printf("\n\n");
}
getch();
}
CODING |
OUTPUT |
For any query or suggestion please comment below...
No comments:
Post a Comment