The Air Force has asked you to write a program to label aircrafts as military or civilian. Your program input is the plane's speed and its estimated length. For planes traveling faster than 1100 km/hr, you will label those shorter than 52 m “military", and longer as “Civilian". For planes traveling less than 1100, you will issue an “aircraft unknown" statement.
#include <stdio.h>
int main()
{
int speed;
int length;
printf("Enter speed: ");
scanf("%d", &speed);
printf("Enter length: ");
scanf("%d", &length);
if (speed>1100){
if(length<52){
printf("military");
}
else if(length>52){
printf("Civilian");
}
}
else if(speed<1100){
printf("aircraft unknown");
}
return 0;
}
Comments