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

How do we implement inheritance in c++?

584


Why do we use iterators?

616


Write a program to interchange 2 variables without using the third one.

579


Why c++ is called oop?

593


What is token c++?

574






Write a program which uses Command Line Arguments

631


Why pointer is used in c++?

609


Mention the purpose of istream class?

615


What are the characteristics of friend functions?

559


What is the function to call to turn an ascii string into a long?

595


Can I learn c++ without learning c?

561


why and when we can declar member fuction as a private in the class?

1595


What is stream and its types in c++?

552


What's the most powerful programming language?

584


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

5895