Swift Program to Demonstrate the if Else Statement

You are currently viewing Swift Program to Demonstrate the if Else Statement

Swift program to demonstrate the if else statement

// Swift program to demonstrate the if else statement

var num:Int=22;

if(num%2 == 0)
{
    print("Number is EVEN");
}
else
{
    print("Number is ODD");
}

Output

Number is EVEN

...Program finished with exit code 0
Press ENTER to exit console.

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply