Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Nested If-Else in Decision Statements of Programming in C
2219 Views
Nested If-Else 
Nested If-Else is If inside If. Outer If statement will check first If it is true then the Inside If statement will checked.
Syntax 
If (condition or expression)
{
   statements;
   If (condition or expression)
   {
      statements;
   }
   else
   {
      statements;
   }
}
else
{
   statements;
}
Program
#include
void main(){
    int a,b,c;
    printf("Enter a,b,c values\n");
    scanf("%d%d%d",&a,&b,&c);
    if (a > b){
            if (a > c){
                printf("A is big");
           }
    else {
            printf("C is big");
            }
    }
    else if (b > c){
           printf("B is big");
    }
    else {
           printf("C is big");
    }
}
Output 
Enter a,b,c values
12
23
34

C is big
Next Topics
Next lessons of current book.
Decision Statements of Programming in C
Decision Statements of Programming in C
Looping 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
Decision Statements 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