Convert the number from Indian system to International system
Given an input string N consisting of numerals and separators (, ) in the Indian Numeric System, the task is to print the string after placing separators(, ) based on International Numeric System.
Input: N = “12, 34, 56, 789”
Output: 123, 456, 789
Input: N = “90, 05, 00, 00, 000”
Output: 90, 050, 000, 000
- Remove all the separators (, ) from the string.
- Iterate from the end of the string and place a separator(, ) after every third number.
- Print the result.
Below is the implementation of the above approach:
Related article: Convert the number from International system to Indian system
My Personal Notes arrow_drop_up
Please Login to comment...