Skip to content

Instantly share code, notes, and snippets.

@dbc2201
Created November 28, 2018 11:30
Show Gist options
  • Save dbc2201/a45235ae3afb62a20eed4ec477bc16af to your computer and use it in GitHub Desktop.
Save dbc2201/a45235ae3afb62a20eed4ec477bc16af to your computer and use it in GitHub Desktop.
working of if-else-if ladder
#include<stdio.h>
int main()
{
int a, b = 5, c = 12;
printf("Enter an integer value:\n");
scanf("%d", &a);
if ( a > 10 )
{
printf("%d is greater than 10.\n", a);
}
else if ( a == 10 )
{
printf("%d is equal 10.\n", a);
}
else // if ( a < 10 )
{
printf("%d is smaller than 10.\n", a);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment