Question: Please write in C Write a complete program The program must do the following: Opens an input file in.txt for reading. Reads the first line
Write a complete program The program must do the following: Opens an input file "in.txt" for reading. Reads the first line from the file and saves its content in a local variable (as an int) firstint. Reads the second line from the file and saves its content in a local variable (as an int) secondent. Uses a predefined function isMultiple() to decide if secondent is a multiple of firstint. (see function prototype of isMultiple() below) / isMultiple determines for a pair of integers if the second integer is a multiple of t he first The function returns 1 (true) if the second is a multiple of the first, it returns (false) if the second is not a multiple of the first int isMultiple (int firstValue, int secondValue); Prints the result to stdout (the screen), see example file content and output below. Example 1 content of the file in.txt: 2 4 Output to the screen (when using example 1); 4 is a multiple of 2 Example 2 content of the file in.txt: 3 5 Output to the screen (when using example 2): 5 is not a multiple of 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
