program to print this triangle
*
* *
* * *
Answer Posted / dhruv kaushal
//Made by- Dhruv Kaushal visit bestindiasongs.blogspot.com
//Programe starts from Next line
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,k,l;
for(i=1;i<=4;i++)
{
cout<<"\n";
for(j=4;j>=i;j--)
{
cout<<" ";
}
for(k=1;k<=i;k++)
{
cout<<"*";
}
for(l=2;l<=i;l++)
{
cout<<"*";
}
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the difference between delegation and implemented-in-terms-of?
What do you mean by static variables?
How do you flush a buffer in c++?
What is tellg () in c++?
Define upcasting.
Which software is used for c++ programming?
Can we run c program in turbo c++?
What is the use of "new" operator?
How are the features of c++ different from c?
What are the differences between malloc() and calloc()?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
How do you generate a random number in c++?
Why do we use using namespace std in c++?
How would you implement a substr() function that extracts a sub string from a given string?
what are the iterator and generic algorithms.