Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

in c++ ++ how to write if without if

(expression 1) ? expression 2 : expression 3 ---->If expression 1 is
evaluates to true, then the expression 2 is evaluated else then the expression 3
is evaluated.
Example :
  int s = (20 >= 2) ? 30 : 40;
   cout << s ;  //prints 30
 
PREVIOUS NEXT
Tagged: #write
ADD COMMENT
Topic
Name
3+9 =