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


Please Help Members By Posting Answers For Below Questions

What is a class template in c++?

770


Explain the concept of copy constructor?

801


What is the full form of ios?

748


What is virtual destructor ans explain its use?

831


What is size of string in c++?

730


Explain unexpected() function?

807


What is virtual function? Explain with an example

794


What is the default access level?

811


Define a nested class.

818


What is pure virtual function? Or what is abstract class?

804


What is an adaptor class or wrapper class in c++?

798


What are the general quetions are in DEna bank manager IT/System interviews?

1771


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

822


Does there exist any other function which can be used to convert an integer or a float to a string?

828


Explain the properties and principles of oop.

721