write a c++ program that gives output
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
using looping statement
Answers were Sorted based on User's Feedback
Answer / akhil
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enter limit";
cin>>n;
for(i=1;i<=n;i++)
//cout<<"/n"; for printing line by line
for(j=1;j<=i;j++)
cout<<j;//
getch();
}
| Is This Answer Correct ? | 18 Yes | 1 No |
Answer / ramesh.bugatha78
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
cout<<j;
cout<<"\n";
}
| Is This Answer Correct ? | 8 Yes | 0 No |
What is stack unwinding?
What is the difference between the parameter to a template and the parameter to a function?
Differentiate between late binding and early binding.
What is a concrete class?
What is a type library?
Can a program run without main in c++?
Can we use clrscr in c++?
Why did you leave your last job?
Define basic type of variable used for a different condition in C++?
Explain the difference between c & c++?
structure that describe a hotel with name, address,rooms and number of rooms
what kind of projects are suitable for c and c++