Sail E0 Webinar
Question

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

Options:
A .  6
B .  5
C .  4
D .  7
Answer: Option A


Here the condition is false on conditional operator, so the b value is assigned to c



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers