Question: Develop a C program that receives as input a distance value, d, in inches and converts it to yards, feet, and inches (1 yard =

 Develop a C program that receives as input a distance value,d, in inches and converts it to yards, feet, and inches (1

Develop a C program that receives as input a distance value, d, in inches and converts it to yards, feet, and inches (1 yard = 3 feet, 1 foot = 12 inches). Your program should: 1. Read a set of distances from a file called dist.txt 2. Use a function called distConverter to break distance to yards, feet, and inches. 3. Print the conversion result on screen in the main function (not within the distConverter function) The distConverter function prototype should be: void distConverter (int d, int *py, int *pf, int *pi) Sample Output dist.txt file: 130 19 4 12 337 162 0 inches: 130 19 . : yards feet inches 3 1 10 0 1 7 0 0 4 4. : 12 : 0 1 0 337 : 9 1 162 . 4 1 O O P : 0 main.c Load default template... 1 #include 2 void distConverter(int d, int *p_y, int *p_f, int *p_i); 3 4 int main(void){ 5 // add your code here 6 7 return 0; 8 } 9 10 void distConverter(int d, int *p_y, int *p_f, int *p_i){ 11 12 //develop the distance converter function here 13 } 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!