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 sorting algorithm does c++ use?

602


What is capacity in vector in c++?

551


what you know about c++?

665


Which programming language is best to learn first?

585


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

551






What is abstract keyword in c++?

593


What is #include ctype h in c++?

669


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

625


Explain the use of vtable.

618


How can an improvement in the quality of software be done by try/catch/throw?

594


explain the reference variable in c++?

580


Can the creation of operator** is allowed to perform the to-the-power-of operations?

582


What is the arrow operator in c++?

562


What is the array and initializing arrays in c++?

508


What is the iunknown interface?

680