Answers for "how to use ternary operator swift"

0

Swift Ternary Operator

// program to check pass or fail
let marks = 60

// use of ternary operator
let result = (marks >= 40) ? "pass" : "fail"

print("You " + result + " the exam")
Posted by: Guest on May-09-2021
0

ternary operator swift 5

// Ternary operator ==>
 // value = condition ? valueIfTrue : valueIfFalse
Posted by: Guest on May-25-2021

Code answers related to "how to use ternary operator swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language