write the code that display the format just like
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
6 5 4 3 2 1
Answer Posted / gayatri chhotray
int main()
{
int i;
int j;
for(i = 1; i <= 6; i++)
{
for(j = i; j >= 1; j--)
{
cout<<j<<" ";
}
}
return 0;
}
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What is algorithm in c++ programming?
Does c++ vector allocate memory?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Do class method definitions?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What are the uses of c++ in the real world?
What is meant by iomanip in c++?
How do you find out if a linked-list has an end?
What is scope operator in c++?
What is pair in c++?
What sorting algorithm does c++ use?
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 What is the use of :: operator in c++? How would you call C functions from C++ and vice versa? Why #include is used?