if , swift code example
Example: swift if else statement
// check the number is positive or negative
let num = 15
var result = ""
if (num > 0) {
result = "Positive Number"
}
else {
result = "Negative Number"
}
print(result)
// check the number is positive or negative
let num = 15
var result = ""
if (num > 0) {
result = "Positive Number"
}
else {
result = "Negative Number"
}
print(result)