Article by: Manish Methani
Published on: October 13, 2021 at 8:04am
2 mins 51 sec read
Sometimes in a program we need to test a condition. If that condition is true we perform first action and if the condition is false we perform second action.
Now what does that mean?
if statement is used to test a given condition. If given condition is satisfied then only block inside if statement will gets executed.
import UIKit var a:Int = 10 if(a == 10) { print("a = (a)") }
a = 10
In this swift program we first initialised a variable "a" with value "10" . Then if condition checks wether 'a == 10' or not . Since value matches block inside if is executed. That's why output 'a = 10' .
Your go-to place to discover the Software Products, latest Tech News and Coding. Ignite Ideas, Unleash Innovation!
Codzify opens the door to a wealth of programming videos, free courses, mock tests, and endless opportunities for learning. Join us today and let your coding journey begin!
Start for Free. Login Now!Explore Coding in Simplified Way with Codzify.com
Online Coding Courses
Simplified Angular 16 Course from Basic to Advanced
Master the Skill of C Porgamming in 30 days.
Flutter App Development Course in Hindi
The Complete 2023 Web Development Bootcamp by Manish Methani | Udemy Course
Complete Flutter App Development Course for Beginners (2023) | Udemy Course
Quick Links