Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Switch Statement Program1

var p = 125
if p == 10 {
    p = p + 10
    print(p)
} else if p < 10 {
    p = p + 100
    print(p)
} else {
    p = p + 2
    print(p)
    switch p {
        case 127 :
            let stringA = ""
            if stringA.isEmpty{
                print("String is Empty")
                if p == 127 {
                    let char : Character = "Hello"
                    print(" Character value is \(char) ")
                }
            } else {
                print("String is not empty")
            }
        default :
            p = p + 4
            print("P is values \(p) ")
    }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.