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

How long does it take to get good at leetcode?

655


What are advantages of c++?

560


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

1830


describe private access specifiers?

637


How did c++ start?

607






what are the events occur in intr activated on interrupt vector table

1176


What are dynamic type checking?

613


What is the difference between an external iterator and an internal iterator?

608


How are Structure passing and returning implemented by the compiler?

593


What is void pointer in c++ with example?

593


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

608


What is c++ stringstream?

601


What is the best c++ book for beginners?

568


Is string data type in c++?

579


What is the difference between a "copy constructor" and an "assignment operator" in C++?

616