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
How long does it take to get good at leetcode?
What are advantages of c++?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
describe private access specifiers?
How did c++ start?
what are the events occur in intr activated on interrupt vector table
What are dynamic type checking?
What is the difference between an external iterator and an internal iterator?
How are Structure passing and returning implemented by the compiler?
What is void pointer in c++ with example?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What is c++ stringstream?
What is the best c++ book for beginners?
Is string data type in c++?
What is the difference between a "copy constructor" and an "assignment operator" in C++?