How to use the nested conditional ternary operator in Swift

1 Answer

0 votes
import Foundation

let score = 85

let grade = score >= 90 ? "A" : score >= 80 ? "B" : "C"

print(grade) 



/*
run:

B

*/

 



answered May 13 by avibootz
...