Answers for "short hand if else in c"

C++
6

if statement shorthand c

if (true)
	printf("This is the shorthand");

// OR

(true) ? (/*run if true*/) : (/*run if false*/);
Posted by: Guest on July-03-2020
0

c++ ternary statement

x = condition ? expression1 : expression2

// Example:
double x = 1 > 0 ? 10 : 20; // put any value
Posted by: Guest on December-09-2020

Browse Popular Code Answers by Language