program to print this triangle
*
* *
* * *
Answer Posted / mayank murari
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<4;i++)
{
for(j=4;j>=i;j--)
{
printf(" ");
}
for(k=1;k<2*i;k++)
{
printf("*");
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What data encapsulation is in c++?
How to access a variable of the structure?
What are dynamic type checking?
Can I learn c++ in a week?
What is the use of ::(scope resolution operator)?
How do you write a function that can reverse a linked-list?
How to declare a function pointer?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What are stacks? Give an example where they are useful.
Explain unexpected() function?
What is the difference between a type-specific template friend class and a general template friend class?
What is the history of c++?
What is operator overloading in c++ example?
What do you mean by a template?
Describe private, protected and public – the differences and give examples.