Question: To round off an integer i to the next largest even multiple of another integer j , the following formula can be used: int next
To round off an integer i to the next largest even multiple of another integer j the
following formula can be used: int nextmultiple i j i j
For example, to round off days to the next largest number of days
evenly divisible by a week, values of i and j can be substituted
into the preceding formula as follows:
int nextmultiple
Write a program to find the next largest even multiple for the following values of i
and j:
i j
All of your code should go into the main function do not use separate functions
Print your output for each exercise to the console in a nicely formatted way to
differentiate the answers. Make sure to save your answer from each exercise in a
separate variable.
Part C
print out each answer to the console again, this time typecast to an
int
double
char
Again, format the output nicely using format specifiers, and be aware that some
results will be junk.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
