What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 6, c;
c = (a > b) ? a : b;
cout << c;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 6, c;
c = (a > b) ? a : b;
cout << c;
return 0;
}
A. 6
B. 5
C. 4
D. 7
Answer: Option A
Related Questions on Operators and Expressions in C plus plus
What is the operator precedence of the multiplication operator (*) in C++?
A. Highest
B. Lowest
C. Equal to addition
D. Equal to subtraction
Join The Discussion