Question: REFACTORING PRACTICE TASKS Refactoring Practice A Consider the following function definition which is provided to you: int Divisible ( int rem ) i int divisible;
REFACTORING PRACTICE TASKS
Refactoring Practice
Consider the following function definition which is provided to you:
int Divisible int rem
i
int divisible;
if rem
divisible ;
else
divisible
return divisible;
Can you modify the definition of this function ie the lines of code inside the curly braces to make it simpler? Hint: it is possible to rewrite this function using just a single line of code inside the curly braces so that it behaves exactly the same as defined above.
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
