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>
- Start a variable with zero; It will hold the last value.
- If there are no other numbers in the string, then the algorithm is complete, and the variable holds numeric values.
- Get the next point (
- Multiply the variable by ten and then add to the digits obtained in step 3.
- 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
Post a Comment