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

int main()
{
int i;
int j;
for(i = 1; i <= 6; i++)
{
for(j = i; j >= 1; j--)
cout<<j<<" ";
cout<<endl;
}
return 0;
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lvalue?

701


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

620


What is the difference between #import and #include?

555


When does a 'this' pointer get created?

624


What is the identity function in c++? How is it useful?

553






Write a program to concatenate two strings.

593


What is diamond problem in c++?

542


Can constructor be static in c++?

644


What is the full form of dos?

570


State the difference between delete and delete[].

581


If dog is a friend of boy, is boy a friend of dog?

575


Please explain the reference variable in c++?

618


What do you mean by global variables?

573


When should overload new operator on a global basis or a class basis?

617


Can comments be longer than one line?

626