May 20, 2020

If-else statement in C

If-else statements are used to control the flow of Program based on some conditions, only the difference is it is used to execute some statement code blocks. if the expression is evaluated to true, otherwise it executes else block. Which is shown in below flow chart.




Syntax:

if(condition)
{
       //block of statements;
}
else
{
      //block of statements;
}


Above syntax shows the working of if-else statement.



Share This:    Facebook Twitter

0 comments:

Post a Comment

If you have any doubts, please discuss here...