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 java is different from c and c++?

815


What is the output of the following program? Why?

720


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2189


Explain this pointer?

685


What is meaning of in c++?

762






What is enum class in c++?

792


Define stacks. Provide an example where they are useful.

679


What is c++ iterator?

739


Can we define a constructor as virtual in c++?

688


Explain virtual destructor?

800


Write a program to concatenate two strings.

679


What is the full form of c++?

717


Define whitespace in C++.

860


What language is a dll written in?

620


What does new in c++ do?

650