The output of
{
int a = 5;
int b = 10;
cout << (a>b?a:b);
}

Options
- 5
- 10
- Syntax error
- None of above


CORRECT ANSWER : 10

Discussion Board
C++ - Trace the Output

The above program will print 10.

Prajakta Pandit 01-25-2017 04:01 AM

fd

@vishal

this code is correct as long as your put the parentheses.

john 04-24-2016 03:45 PM

code

wrong answer in cout we cant give conditional operators

Vishal 06-28-2015 10:06 AM

txn

this is correct answer

gorakh tompe 01-20-2015 10:54 PM

Because

Because it is if condition translayed.
If(a>b) then print a else print b.

Olfat 08-23-2014 11:57 AM

net.frame

want to study

diya 03-6-2014 12:26 PM

Why?

Does anyone knows why it's 10 and not 5?

SNH 10-7-2013 01:27 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement