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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ library?

605


What is a breakpoint?

573


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

570


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include //INCLUDE EVERY KNOWN HEADER FILE #include //FOR ANY CASE... #include #include #include main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<

1823


Why do we use the using declaration?

670






What is the difference between global variables and local variable

546


Is java made in c++?

595


What are the benefits of pointers?

608


What is the difference between the parameter to a template and the parameter to a function?

650


What is the arrow operator in c++?

570


What is a class definition?

624


What is exception handling? Does c++ support exception handling?

601


What is string in c++ programming?

636


What is c++ and its features?

582


What is the need of a destructor? Explain with the help of an example.

576