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
Describe protected access specifiers?
What are the differences between the function prototype and the function defi-nition?
What is difference between c++ and c ++ 14?
How does work in c++?
Difference between pass by value and pass by reference?
Explain "const" reference arguments in function?
What is a volatile variable in c++?
What is a storage class?
How does com provide language transparency?
What is virtual function? Explain with an example
Is java as fast as c++?
Explain about templates of C++.
What is the role of static keyword for a class member variable?
What are the advantages of using typedef in a program?
What is the difference between a pointer and a link in c ++?