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
Answer Posted / 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 |
Post New Answer View All Answers
What is a constant? Explain with an example.
Explain the concept of friend function in c++?
Explain virtual destructor?
What is class syntax c++?
what is C++ objects?
Define basic type of variable used for a different condition in C++?
Explain terminate() and unexpected() function?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What are the important differences between c++ and java?
How is c++ different from java?
Declare a class vehicle and make it an abstract data type.
which operator is used for performing an exponential operation a) > b) ^ c) none
What is anonymous object in c++?
What is the default width for ouputting a long integer using the insertion operator?
What are the advantages of using a pointer? Define the operators that can be used with a pointer.