program to print this triangle
*
* *
* * *
Answer Posted / mayank murari
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<4;i++)
{
for(j=4;j>=i;j--)
{
printf(" ");
}
for(k=1;k<2*i;k++)
{
printf("*");
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What is called array?
How do I download c++?
What is the difference between an array and a list?
Can a class be static in c++?
What are virtual constructors/destructors?
What is a template in c++?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
Is c++ the hardest language?
Is c++ platform dependent?
What are the extraction and insertion operators in c++? Explain with examples.
What is difference between n and endl in c++?
What is using namespace std in c++?
Why do we need constructors in c++?
What is the this pointer?