Answer to Question #197647 in C for Ahmed hossam

Question #197647

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.


1
Expert's answer
2021-05-24T00:12:11-0400


#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS