Reading
Add Comment
Conditional Statement in Objective-C
Taking after is the general manifestation of a commonplace choice making structure found in the majority of the programming dialects:
Objective-C programming dialect accept any non-zero and non-invalid values as genuine, and in the event that it is either zero or invalid, then it is expected as false esteem.
Objective-C programming dialect gives taking after sorts of choice making proclamations. Click the accompanying connections to check their points of interest:
Statement | Description |
---|---|
if statement | An if statement consists of a boolean expression followed by one or more statements. |
if...else statement | An if statement can be followed by an optional else statement, which executes when the boolean expression is false. |
nested if statements | You can use one if or else if statement inside another if or else ifstatement(s). |
switch statement | A switch statement allows a variable to be tested for equality against a list of values. |
nested switch statements | You can use one switch statement inside another switchstatement(s). |
The ? : Operator:
We have secured contingent administrator ? : in past section which can be utilized to supplant if...else articulations. It has the accompanying general structure:
Exp1 ? Exp2 : Exp3;
Where Exp1, Exp2, and Exp3 are declarations. Notice the utilization and position of the colon.
The estimation of a ? declaration is resolved like this: Exp1 is assessed. In the event that it is genuine, then Exp2 is assessed and turns into the estimation of the whole ? outflow. In the event that Exp1 is false, then Exp3 is assessed and its esteem turns into the estimation of the representation.
0 comments:
Post a Comment