In: Computer Science
Create a small program that contains the following.
Required code in C -->
#include <stdio.h>
int main(){
int a,b,c; // declare variables for three numbers as datatype
int
char name; // declare variable for name as datatype char
printf("Enter your name : ");
scanf("%s",&name); // read name from user
printf("Enter first number\n");
scanf("%d",&a); // read first number from user
printf("Enter second number\n");
scanf("%d",&b); // read second number from user
printf("Enter third number\n");
scanf("%d",&c); // read third number from user
if((a>b && c>a)||(a>c && b>a)){
printf("First number is between second and third number");
}
else{
printf("First number is not in between of second and third
number");
}
}
If statement will then evaluate if the first number is between second number and third number, if yes then output will be "First number is between second and third number" else "First number is not in between of second and third number".