Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the tenary operator in C with 3 numbers
#5
(08-08-2024, 08:53 PM)Pete Wrote: I kook at it as shorthand...

C=(A>B)?A:B; 

meaning:

If A > B Then C = A Else C = B

Pete
I do not think so!

Code: (Select All)

a = 5
b = 4
c = 7

If a > b Then
  c = a
Else
  c = b
End If

Print c

There c would have to be the largest number, right?  Huh
Reply


Messages In This Thread
RE: Using the tenary operator in C with 3 numbers - by Kernelpanic - 08-08-2024, 09:23 PM



Users browsing this thread: 2 Guest(s)