program to print this triangle
*
* *
* * *
Answer Posted / vivek kumar
#include <stdio.h>
#define MAX 6
int main()
{
int i, j,k;
for(i = 0; i < MAX; i++)
{
for(j = 0; j < MAX-1-i; j++)
printf("\t");
if(i == 0)
printf("*\t");
else
for(k = 0; k < i*2+1; k++)
printf("*\t");
printf("\n");
}
return 0;
}
| Is This Answer Correct ? | 12 Yes | 5 No |
Post New Answer View All Answers
What are advantages of using friend classes?
How to declaring variables in c++?
How a new element can be added or pushed in a stack?
Explain the use of vtable.
Can we overload operator in c++?
Should a constructor be public or private?
What is private public protected in c++?
What is a constant reference?
What is :: operator in c++?
What is the best free c++ compiler for windows?
What is the role of C++ shorthand's?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
What are compilers in c++?
Is c++ faster than c?
How can virtual functions in c++ be implemented?