Answers for "ternary comparison 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

Code answers related to "Swift"

Browse Popular Code Answers by Language