Question: Given a number N that represents the block number where John is standing. Write a program that reads the number representing the block number of
Given a number that represents the block
number where John is standing.
Write a program that reads the number
representing the block number of John and prints
the block number that is nearest to John's block
number. If multiple treasure boxes are at the same
distance from John's block number, print the
block number that is in the forward direction to
him block number that is greater than John's
block number
If multiple treasure boxes are at the same
distance from John's block number, print the
block number that is in forward direction to
him block number that is greater than John's
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
