Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Swift if..else if

// check whether a number is positive, negative, or 0.

let number = 0

if (number > 0) {
    print("Number is positive.")
}

else if (number < 0) {
    print("Number is negative")
}

else {
    print("Number is 0.")
}

print("This statement is always executed")
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #Swift
ADD COMMENT
Topic
Name
8+4 =