I'm very very new at C programming/writing and I'm so confused, I have no idea what I'm doing. I was given this problem to do and I'm so confused on what to put on the Printf() statement... I don't know what kind of set up it should have either. What should be on the printf(.....) statement to calculate 123 seconds into minutes and seconds (2 minutes and 3 seconds.)
Please help:
Code:/* Convert seconds to minutes and seconds. */Code:#include<stdio.h> int main(void) { int input_value, minutes, seconds; printf("Input the number of seconds:"); scanf("%d", &input_value); minutes=input_value / 60; seconds=input_value % 60; printf(.....); return 0; }
2)I have two other I don't quite understand, if someone can please give me some help, and explain just the basics of the codes, but if not the answers are fine:
Write an interactive program that asks the user to input the length and width of a rectangular lawn. The dimensions should be in yards. Your program should compute the area of the lawn in square yard, square feet, and square inches. Print all the information neatly on the scree. Use the following declaration:
Code:int cv_factor = 36 * 36; /* conversion:sq in per yrd */Code:or int cv_factor= 1296; /* conversion: sq in per yrd */
3)Here is a part of an interactive program that computes the value of some coins. The user is asked to input the number of half dollars, quarters, dimes, and so on.
Code:#include<stdio.h>Code:int main(void) { int h, /* number of half dollars */ q, /* number of quarters */ d, /*number of dimes */ n, /*number of nickels */ p; /*number of pennies*/ ..... printf("Value of your change will be computed. \n\n"); printf("How many half dollars do you have?"); scanf("%d", &h); printf("How many quarters do you have?"); scanf("%d" , &q);
Complete the program, causing it to print out relevant information. For example, you may want to create out that looks like this:
You entered: 0 half dollars
3 quarters
2 dimes
17 nickels
1 pennies
The values of your 23 coins is equivalent to 181 pennies