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 is the use of typedef?
What is the full form of stl in c++?
Is map sorted c++?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
Why do we use the using declaration?
What is enum class in c++?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
What is the use of lambda in c++?
Search for: what is pair in c++?
What is the difference between #define debug 0 and #undef debug?
How many different levels of pointers are there?
What is a binary file? List the merits and demerits of the binary file usagein C++.
What is overloading unary operator?
Briefly describe a B+ tree. What is bulk loading in it?
What is the standard template library (stl)?