c - Can someone give me the example of this algorithm -


Written in great code section 1, this algorithm is written for the conversion of an integer value of decimal digits string: / P>

  1. Start a variable with zero; It will hold the last value.
  2. If there are no other numbers in the string, then the algorithm is complete, and the variable holds numeric values.
  3. Get the next point (
  4. Multiply the variable by ten and then add to the digits obtained in step 3.
  5. Go to step 2 and repeat.

    I do not know how the conversion is happening. Please give an example of this

    Consider the string

      string variable (1134 0 (1) 134 0 * 10 + 1 = 1 1 (1) 34 1 * 10 + 1 = 11 11 (3) 4 11 * 10 + 3 = 113 113 (4) 113 * 10 + 4 = 1134    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -