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

Specify different types of decision control statements?

357


Write syntax to define friend functions in C++.

603


Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);

618


write a programme to get a character and thier ASCII value

2598


Is c++ proprietary?

582






What is a Default constructor?

924


What is prototype for that c string function?

692


What is the need of a destructor? Explain with the help of an example.

570


Can there be at least some solution to determine the number of arguments passed to a variable argument list function?

605


What is c++ try block?

583


If I is an integer variable, which is faster ++i or i++?

593


What are arithmetic operators?

542


Refer to a name of class or function that is defined within a namespace?

615


Are strings mutable in c++?

694


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

617