Session 3 Swift IOS Code

  IOS Mobile Application Development        

Session 3 Swift IOS Code

---If, else if, else statement in Swift complete with example

var number = 0
if (number > 0)
{
    print("True")
}
else if (number < 0)
{
print("Number is Greater ")
}
else
{
    print("Default")
}

///Nested if Statement
var a = 1
var b = 2;
if(a == 1)
{
    print("1")
    
    if(b == 12)
    {
        print("2")
    }
}
else
{
    if(a == 1)
    {

    }
}

No comments:

Post a Comment

Fell free to write your query in comment. Your Comments will be fully encouraged.