Code:
#include<stdio.h>
using namespace std;
int main()
{
int numb=0;
printf("Enter the size of triangle = ");
scanf("%d",&numb);
for(int i=0;i<numb;i++)
{
for(int b=numb;b>i;b--)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output
#include<stdio.h>
using namespace std;
int main()
{
int numb=0;
printf("Enter the size of triangle = ");
scanf("%d",&numb);
for(int i=0;i<numb;i++)
{
for(int b=numb;b>i;b--)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output
0 Questions:
Post a Comment