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 |
Is vector a class in c++?
How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed.
Can we use this pointer inside static member function?
What are all predefined data types in c++?
Describe private, protected and public – the differences and give examples.
Explain what happens when a pointer is deleted twice?
What are the differences between the function prototype and the function defi-nition?
How const functions will be treated by compiler?
How to write a program such that it will delete itself after exectution?
Which one is better- macro or function?
How many types of casting are there in C++? When is a dynamic cast,static_cast,reinterpret cast used?
What is c++ library?