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");
for(k = 0; k < i*2+1; k++)
printf("*\t");
printf("\n");
}
return 0;
}
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
What is encapsulation in C++? Give an example.
What new()is different from malloc()?
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.
Tell me can a pure virtual function have an implementation?
What does return 0 do in c++?
Is c++ an integer?
What is overloading unary operator?
Is linux written in c or c++?
Can we use this pointer inside static member function?
What are advantages of using friend classes?
Is c# written in c++?
What is conditions when using boolean operators?
Which bitwise operator is used to check whether a particular bit is on or off?
What are the types of container classes?
What is an adaptor class in c++?