For e-learning, various tutorials are provided to the students.

 For e-learning, various tutorials are provided to the students. One of the tutorials shows the highlighter on a number A on the number line. There is a "jump" button in the tutorial. On pressing the "jump" button, the highlighter moves by a fixed number D towards the right side if D is positive and towards the left side if D is negative. The student has to press the button N number of times. The tutorial has various sets of exercises. For every exercise, the positions of the highlighter before every "jump" button press will be stored in the database. Write an algorithm to find the position of the highlighter before.....




Comments

Popular posts from this blog

EV Minimize Array Cost asked in Infosys- march 2022 (available in c++ only)

Complete Binary tree(CBT) and Almost Complete Binary tree(ACBT): Total nodes and formulae :

PERFECT SQUARE asked by MountainBlue