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 |
You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.
What are stacks? Give an example where they are useful.
What is the latest version on c++?
Explain the advantages of using friend classes.
CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?
What is difference between array and vector in c++?
To which numbering system can the binary number 1101100100111100 be easily converted to?
Why is main function important?
Is c++ harder than java?
iam a fresher to Qt(GUI a c++ based framework software). i need to develop the basic applications on designer by drag and dropping mechanism...so pls send me the procedure to design applications?
What does ctime() do?
State the difference between pre and post increment/decrement operations.