Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Else-If in Decision Statements of Programming in C
1937 Views
Else-If 
ELSE-IF is also decision making statement. It is used to check more than one conditions as one by one. If first condition is true then the block of statements will execute otherwise if next condition is true then executes its block of statements. If all conditions are false then the ELSE block will execute.
Syntax 
If (condition or expression)
{
   statements;
}
else if (condition or expression)
{
   statements;
}
else
{
   statements;
}
Program
#include
void main(){
    int a,b,c;
    printf("Enter a,b and c values\n");
    scanf("%d%d%d",&a,&b,&c);
    if (a>b && a>c)
    printf("A is big");
    else if (b > c)
    printf("B is big");
    else
    printf("C is big");
}
Output 
Enter a,b and c values
12
23
14

B is big
Next Topics
Next lessons of current book.
Decision Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Looping Statements of Programming in C
Looping Statements of Programming in C
Previous Topics
Previous lessons of current book.
Decision Statements of Programming in C
Decision Statements of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details