The if-else Statement

Now and again we need a bunch of guidelines to be executed if a specific condition is fulfilled and a unique arrangement of directions to be executed if the condition doesn't satisfy. This sort of circumstance is managed in C language utilizing a choice control guidance. Today, we will talk about if-else joints in C programming.
Like other programming languages, C likewise utilizes the if the signal to execute the choice control guidance. The condition for the in-case explanation is constantly encased inside a couple of enclosures. Assuming the condition is valid, the arrangement of explanations will execute. Assuming the condition isn't correct, the announcement won't execute, all things being equal, the program skirts that part.
We express a condition for if promulgations utilizing social administrators. The social administrators permit us to contrast two qualities with see whether -
Conditions | Meaning |
a == b | a is equal to b |
a != b | a is not equal to b |
a < b | a is less than b |
a> b | a is greater than b |
a <= b | a is less than or equal to b |
a >= b | a is greater than or equal to b |
The assertion was written in if square will execute when the connection following if assesses to valid. However, when the in the case is composed with the else block when the condition written in the assuming square goes to be false, the arrangement of connections in the else square will execute.
Settled If-Else Statements -
We can compose a whole if-else joint inside either the body of the if an announcement or the body of an else explanation. This is called the 'settling' of uncertainties.
0 Comments