DamnSchool
It is basically two way decision making statement and always used in conjunction with condition. It is used to control the flow of execution and also used to carry out the logical test and then pickup one of the two possible actions depending on the logical test. It is used to execute some statements when the condition is true and execute some other statements, when the condition is false.

If else statement

#include<stdio.h>
int main()
{
int i=1;
if(i<10)
{printf("The number %d is < 10",i);}
else
{printf("The number %d is > 10",i);}
}

Run Example >

< Previous Next >

Privacy Policy Terms of Service About
Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.