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
Define a nested class. Explain how it can be useful.
Is c++ harder than java?
What is difference between c++ 11 and c++ 14?
Write a Program for find and replace a character in a string.
What are the various storage classes in C++?
What happens if a pointer is deleted twice?
When should we use container classes instead of arrays?
Why do we need c++?
How a macro differs from a template?
How do you define/declare constants in c++?
What is the use of string in c++?
What parameter does the constructor to an ofstream object take?
Why c++ is better than c language?
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 c++