Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
CPP 3
« Previous
Next »
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
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲