Question: Write a C program that calculates the greater distance between two routes in miles. The program should accomplish the tasks below: Define a preprocessor constant
Write a C program that calculates the greater distance between two routes in miles. The program should accomplish the tasks below: Define a preprocessor constant for the kilometer conversion rate with at least three digits after the decimal point Define a integer constant using the type qualifier for the yard conversion rate Prompt the user to enter the number of miles traveled in route#1 Prompt the user to enter the number of miles traveled in route#2 Determine whether route#2 is greater than route#1 Calculate the distance traveled in kilometers and yards for the shortest route Print the distance traveled for the shortest route in miles, kilometer, and yards with at most three digits after the decimal point and the minimal field width set to 10 to the screen (stdout) Sample Program Execution: Enter the number of miles for route#1: 320 Enter the number of miles for route#2: 5 The shortest route is:#2 Distance in Miles: 5.000 Distance in Kilometers: 8.047 Distance in Yards: 8800.000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
