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 is an accessor in c++?
Does c++ support multilevel and multiple inheritances?
Give example of a pure virtual function in c++?
Show the application of a dynamic array with the help of an example.
What is buffer and example?
What are virtual constructors/destructors?
What are the defining traits of an object-oriented language?
Write a program to concatenate two strings.
What is the copy-and-swap idiom?
What is the difference between an external iterator and an internal iterator?
What is the extraction operator and what does it do?
What is atoi?
Write a C++ Program to check whether a number is prime number or not?
What is the default width for ouputting a long integer using the insertion operator?
What are the benefits of operator overloading?