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 the average salary of a c++ programmer?

556


What is cin clear () in c++?

625


Explain the differences between private, public and protected and give examples.

583


Why #include is used?

621


What does count ++ do in c++?

706






How can you specify a class in C++?

812


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

579


what are the iterator and generic algorithms.

1696


What is meant by the term name mangling in c++?

526


Why do we use structure in c++?

586


What is the difference between while and do while loop? Explain with examples.

610


What do you understand by zombie objects in c++?

624


What is the full form of ios?

567


How much is c++ certification?

593


What is constructor in C++?

640