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 a class template in c++?
Explain the concept of copy constructor?
What is the full form of ios?
What is virtual destructor ans explain its use?
What is size of string in c++?
Explain unexpected() function?
What is virtual function? Explain with an example
What is the default access level?
Define a nested class.
What is pure virtual function? Or what is abstract class?
What is an adaptor class or wrapper class in c++?
What are the general quetions are in DEna bank manager IT/System interviews?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Does there exist any other function which can be used to convert an integer or a float to a string?
Explain the properties and principles of oop.