C Language ( Please dont give me code for C++. I want the code for C) Write a pr
ID: 3637393 • Letter: C
Question
C Language ( Please dont give me code for C++. I want the code for C)Write a program detailing exactly how much wood a
woodchuck could chuck if a woodchuck could chuck wood.
Relevant Formula:
Amount of wood = (rate_of_chucking * time) - beaver_interference
Remarks: Please replicate the exact text of the prompts and theoutput. Make sure that the roots are printed with two digit precision
(i.e., "%.2f" in printf). Even though the text must be the same, the
numbers may be different depending on the user input.
============= START OF SAMPLE RUN =======================
Enter rate of chucking (branches/second): 0.2
Enter amount of time (s): 60.00
Enter amount of beaver interference (branches): 2.00
Amount of wood (branches): 10.00
============= END OF SAMPLE RUN ======================
Explanation / Answer
please rate - thanks
#include <stdio.h>
#include <conio.h>
int main()
{double rate,time,beaver,wood;
printf("============= START OF SAMPLE RUN ======================= ");
printf("Enter rate of chucking (branches/second): ");
scanf("%lf",&rate);
printf("Enter amount of time (s): ");
scanf("%lf",&time);
printf("Enter amount of beaver interference (branches): ");
scanf("%lf",&beaver);
wood=(rate*time)-beaver;
printf("Amount of wood (branches): %.2f ",wood);
printf("============= END OF SAMPLE RUN ======================= ");
getch();
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.