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 are shallow and deep copy?
Please explain the reference variable in c++?
write a programme to get a character and thier ASCII value
What do you mean by abstraction in C++?
Explain how we implement exception handling in c++?
Give example of a pure virtual function in c++?
Where and why do I have to put the "template" and "typename" keywords?
Explain what is oop?
When is a template a better solution than a base class?
In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that
What is array give example?
founder of c++
7 Answers Microtek, TCS, TeleCommand,