write a C++ programming using for loop:
*
* *
* * *
* * * *

Answer Posted / debotri das

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int line,n,i;
cout<<"Enter no of line\n";
cin>>n;
for(line=1;line<=n;line++)
{
for(i=1;i<=line;i++)
{
cout<<" * ";
}
cout<<" \n ";
}
getch();
}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer to member?

599


Distinguish between a # include and #define.

645


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

3696


What is the output of the following program? Why?

622


Can user-defined object be declared as static data member of another class?

552






Why is it necessary to use a reference in the argument to the copy constructor?

629


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

570


What is lvalue?

695


What is extern c++?

520


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

632


What is the use of map in c++?

606


Can we define function inside main in c++?

553


What is the use of register keyword with the variables?

547


What is c++ redistributable?

619


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2034