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

How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

637


What is a volatile variable in c++?

556


Can you write a function similar to printf()?

665


Why c++ is so important?

602


Explain friend class?

622






Why is c++ a mid-level programming language?

589


What are the vectors in c++?

577


Is c++ harder than java?

564


What are the benefits of pointers?

592


What does flush do c++?

551


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

672


What is general form of pure virtual function? Explain?

506


What is the difference between a template and a macro?

582


What is the best free c++ compiler for windows?

586


What do you mean by volatile and mutable keywords used in c++?

576