Decision-Making Statements

These statements are used for the conditional execution of multiple blocks of statements , i.e , execution dependent on the decision made by the condition . The various statements used for executing loops in C are :

StatementsWhat They Contain..Execution
IfCondition check , executable block . On condition being true .
Else Executable block . On condition being False .
SwitchCharacter to be checked , various cases havin executable blocks .On the character matching a Case .



If Statements

1. If statement is used for checking conditions , and executing them accordingly .
2. They are used in four ways :
3. Simple If
4. If-Else
5. If-Else nested
6. Else-If Ladder


Syntax for 'If else'


if ( condition )

{

 	programming block1

}

else

{

	programming block2

} 




C Example


#include<stdio.h>

#include<stdio.h>

int main() {

	int a=5,b=10;

	if(a>b)

	printf("greater no=%d",a); else

	printf("greater no=%d",b);

	return 0;

}