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 sorting algorithm does c++ use?
What is capacity in vector in c++?
what you know about c++?
Which programming language is best to learn first?
If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?
What is abstract keyword in c++?
What is #include ctype h in c++?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Explain the use of vtable.
How can an improvement in the quality of software be done by try/catch/throw?
explain the reference variable in c++?
Can the creation of operator** is allowed to perform the to-the-power-of operations?
What is the arrow operator in c++?
What is the array and initializing arrays in c++?
What is the iunknown interface?