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

What is flush programming?

578


What is the use of map in c++?

611


How do I run c++?

578


A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.

1746


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1009






Why do we need function?

604


Why do we use the using declaration?

664


Can a program run without main?

633


What are the types of container classes?

622


How long does it take to get good at leetcode?

662


Explain selection sorting. Also write an example.

582


What do you mean by enumerated data type?

580


How do you define/declare constants in c++?

615


Differentiate between an array and a list?

711


How much maximum can you allocate in a single call to malloc()?

637