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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Convert the number from International system to Indian system
- How to validate Indian driving license number using Regular Expression
- How to validate Indian Passport number using Regular Expression
- Convert a given temperature to another system based on given boiling and freezing points
- Program to Convert BCD number into Decimal number
- Convert decimal fraction to binary number
- Program to convert given number of days in terms of Years, Weeks and Days
- Perform n steps to convert every digit of a number in the format [count][digit]
- Convert a number of length N such that it contains any one digit at least 'K' times
- Program to Convert Hexadecimal Number to Binary
- Minimum number of given operations required to convert a string to another string
- Minimum number of adjacent swaps to convert a string into its given anagram
- Number of ways to convert a character X to a string Y
- Minimum number of subsequences required to convert one string to another
- Minimum number of subsequences required to convert one string to another using Greedy Algorithm
- Minimum splits required to convert a number into prime segments
- Count number of ways to convert string S to T by performing K cyclic shifts
- Convert given Decimal number into an irreducible Fraction
- How to convert given number to a character array
- Largest Even and Odd N-digit numbers in Hexadecimal Number System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.