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 switch case in c++ syntax?
What is a block in c++?
Is it possible to provide special behavior for one instance of a template but not for other instances?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What is meant by a delegate?
What is the difference between while and do while loop? Explain with examples.
What is stack unwinding?
What is nested class in c++?
Explain terminate() function?
Differentiate between realloc() and free().
Why is null pointer used?
How can you specify a class in C++?
Define a nested class.
Define a pdb file.
What is an associative container in c++?