Discussion :: C++ - MCQs
-
What is the output of this program?
#include < iostream >
using namespace std;
int main()
{
int a = 5, b = 6, c;
c = (a > b) ? a : b;
cout << c;
return 0;
}
Answer : Option A
Explanation :
Here the condition is false on conditional operator, so the b value is assigned to c
Be The First To Comment