Question: we have to do it in C language. Please write code for the two problems below. Write the code for both problems in functions below
we have to do it in C language.
Please write code for the two problems below. Write the code for both problems in functions below the main function and call both from the main function. The functions should accept data from main, calculate and return the result to main. Getting data from the user and printing the results should be done in main. When completed, the main function should get input data from the user, call the functions, receive the results of the function calls, and print their results to screen. 1. You have saved $500 to use as a down payment on a car. Before beginning your car shopping, you decide to write a function to help you figure out what your monthly payment will be, given the car's purchase price, the monthly interest rate, and the time period over which you will pay back the loan. The formula for calculating your payment is: payment iP 1 - (1 + i)^(-n) where P principal (the amount you borrow) i = monthly interest rate ( 1/12 of the annual rate) total number of payments n = Your program should get input data from the user in the main function in this manner: CALCULATE PAYMENT Enter principal: 500.0 Enter annual interest rate: 6.0 Enter number of payments: 24 Your monthly payment is: 22.16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
