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 flush programming?
What is the use of map in c++?
How do I run c++?
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.
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
Why do we need function?
Why do we use the using declaration?
Can a program run without main?
What are the types of container classes?
How long does it take to get good at leetcode?
Explain selection sorting. Also write an example.
What do you mean by enumerated data type?
How do you define/declare constants in c++?
Differentiate between an array and a list?
How much maximum can you allocate in a single call to malloc()?