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 general format for a prototype?
Describe the process of creation and destruction of a derived class object?
Explain the concept of dynamic allocation of memory?
What is istream c++?
Are strings mutable in c++?
How do you clear a buffer in c++?
Can non graphic characters be used and processed in C++?
Write a short code using c++ to print out all odd number from 1 to 100 using a for loop
What are the various operations performed on stack?
What is the difference between c++ and turbo c++?
Which is best ide for c++?
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
What are the various situations where a copy constructor is invoked?
What is meant by const_cast?
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?