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


Please Help Members By Posting Answers For Below Questions

What is general format for a prototype?

595


Describe the process of creation and destruction of a derived class object?

639


Explain the concept of dynamic allocation of memory?

617


What is istream c++?

565


Are strings mutable in c++?

692






How do you clear a buffer in c++?

535


Can non graphic characters be used and processed in C++?

699


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

584


What are the various operations performed on stack?

627


What is the difference between c++ and turbo c++?

585


Which is best ide for c++?

565


Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

606


What are the various situations where a copy constructor is invoked?

604


What is meant by const_cast?

644


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

556