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


Please Help Members By Posting Answers For Below Questions

Which bit wise operator is suitable for checking whether a particular bit is on or off?

695


Can we distribute function templates and class templates in object libraries?

675


How do you sort a sort function in c++ to sort in descending order?

672


What is runtime polymorphism in c++?

684


What is basic if statement syntax?

646






Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

723


Why do we use using namespace std in c++?

711


What is atoi?

632


Define Virtual function in C++.

730


What is data abstraction? How is it different from data encapsulation?

617


Do you know about C++ 11 standard?

733


Explain how to initialize a const member data.

682


How would you differentiate between a pre and post increment operators while overloading?

738


Can constructor be static in c++?

761


Explain what are accessor methods?

761