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
Specify different types of decision control statements?
Write syntax to define friend functions in C++.
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
write a programme to get a character and thier ASCII value
Is c++ proprietary?
What is a Default constructor?
What is prototype for that c string function?
What is the need of a destructor? Explain with the help of an example.
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
What is c++ try block?
If I is an integer variable, which is faster ++i or i++?
What are arithmetic operators?
Refer to a name of class or function that is defined within a namespace?
Are strings mutable in c++?
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