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
Is c++ an oop?
Explain the different access specifiers for the class member in c++.
Explain the differences between private, public and protected and give examples.
If dog is a friend of boy, is boy a friend of dog?
What is fixed in c++?
Explain container class.
Explain how functions are classified in C++ ?
Why we use #include iostream in c++?
If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3
What is ios flag in c++?
What is the use of string in c++?
What is iterator in c++?
How can you specify a class in C++?
Will c++ be replaced?
What is an adjust field format flag?