Write a program to draw the following figure:
3 2 1
21
1
*
**
***
Program in C Language
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=3;i>=1;i--)
{
for(j=i;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
for(i=1;i<=3;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
No comments:
Post a Comment