Statements-If, If else, If else If.

In programming Conditional statements are used to specify conditions.
This Conditions can be anything.Typically a condition is known when there are more than one ways to be selected on different different scenarios.
For example- If you are trusty you will drink water and if you are not you want.

IF Statement- If statement specifies a signal condition and if the condition is true than the following statements specified under if will be executed and if the condition is false they will not run.

Syntax: If (condition)
    {

        //Statements…//

     } 






If else statement-If else statement is an extended version of if statement having extra clause elsewhich is used to declare statements to be executed when the IF condition is false.

Syntax: If (condition)
    {

        //Statements…//

     } 

else
    {

        //Statements…//

     } 





IF else If Statements-Using this statements you can create several conditions. If either of them is true then statement followed by that condition will be executed, ignoring all other conditions, if none of, the if or if else condition is not met than else part will be executed.

Syntax: If (condition)
    {

        //Statements…//

     } 
else if
    {

        //Statements…//

     } 
else
    {

        //Statements…//

     } 



Axact

İslevselBilgi

Emre Oy Tarafından Tasarlanmıstır

Post A Comment:

0 comments: