else if Statement in C


Use if to specify a block of code to be executed, if a specified condition is true. Use else to specify a block of code to be executed, if the same condition is false. Use else if to specify a new condition to test, if the first condition is false.

Source Code

//else if statement
 
int main()
{
   int a;
   printf("\nEnter The Value of A : ");
   scanf("%d",&a);
   if(a<0)
   {
       printf("%d is Negative Value",a);
   }
   else if(a==0)
   {
       printf("The Given Value is 0");
   }
   else if(a>0)
   {
       printf("%d is Positive Value",a);
   }
    return 0;
}
 
 
To download raw file Click Here

List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C


Learn All in Tamil © Designed & Developed By Tutor Joes