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 are shallow and deep copy?
Are strings mutable in c++?
Who made c++?
What is a dll entry point?
what is data abstraction in C++?
Is map ordered c++?
What is the output of the following program? Why?
What does new return if there is insufficient memory to make your new object?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What is meant by entry controlled loop?
What are stacks?
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.
Can user-defined object be declared as static data member of another class?
What is the difference between public and private data members?
Is multimap sorted c++?