Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1604
  • Last Modified:

easy! short form of "if"

Hi!

real easy one...
whats the short form of "if"...

i know its something like
onebit (zh == 0) ? 1:0;

regards
0
trican
Asked:
trican
1 Solution
 
megaphreakCommented:
to assign the maximum of a and b to z

z = (a>b) ? a : b;

which is the same as

if (a>b)
     z = a;
else
       z=b;

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now