Question: Please write a c file. For each of the programs assig ned below, submit a c opy of the source code (.c , not .c
Please write a c file.
For each of the programs assigned below, submit a copy of the source code (.c, not .cpp file)
Observe the usual guidelines regarding the initial comment section, indenting, and so on. In addition, when functions are required, place function definitions following main. Before each function, use comments to explain what the function does. Do not use global variables.
1. In function main, prompt the user for a time in seconds. Call a function to calculate the equivalent time in hours, minutes, and seconds. Parameters should be the time in total seconds and pointers to the hours, minutes, and seconds. Print the equivalent in hours, minutes, and seconds in function main. (For example, 36884 seconds is equal to 10 hours, 14 minutes, and 44 seconds.)
2. In function main, declare a two-dimensional integer array with 5 rows and 6 columns and other variables for the minimum, row and column number, number of values evenly divisible by five and sum of these numbers, and any other necessary variables. Call the following functions from function main.
If you are using symbolic constants for the number of rows and columns there will be only four parameters.)
Function main should have only declarations and call statements.
For 2 points extra credit:
In function main declare three integers a, b, and c. Call a function randomNumbers to assign a random number between 1 and 50 to each and return using pointer parameters. Print the integers and their addresses in a function printNumbers.
Then call the function order to place the integers in numerical order using pass by address. Function order should have three parameters: int *aPtr, int *bPtr, and int *cPtr. The purpose of function order is to place the three integers in order so that a
The integers should be printed in order with addresses from printNumbers. When the steps of the function order have been completed the smallest value will be stored in a, the middle in b, and the largest in c.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
