C++

Objectives :

  • myConditionalOperation1
  • A conditional expression
    a ? b :c
  • operand1 ? operand2 : operand3
    int n3 = (n1 < n2 ? n2 : n1);
    b1 = n1< n2;
    • The sub-expression "n1<n2" which is left to the ? operator, is evaluated first. If  the condition is  true, the Boolean equivalent is 1,  then operation n2: will be performed, and n2 will receive the value of n1.
  • code : myConditionalOperation1.txt

Step: 1 Create a project

Step: 2 Create a source file

Step: 3 Edit Source code

Step: 4 Runtime View

Step: 5b