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 Passport number using Regular Expression
- How to validate Indian driving license number using Regular Expression
- Calculate the IST : Indian Standard Time
- Convert a given temperature to another system based on given boiling and freezing points
- Convert a number m to n using minimum number of given operations
- Program to Convert Octal Number to Binary Number
- Program to Convert BCD number into Decimal number
- Smallest number to be subtracted to convert given number to a palindrome
- Convert a binary number to hexadecimal number
- Find n'th number in a number system with only 3 and 4
- Program to convert a given number to words
- Program to convert a given number to words | Set 2
- Smallest number to multiply to convert floating point to natural
- Convert decimal fraction to binary number
- Number of steps to convert to prime factors
- Convert to number with digits as 3 and 8 only
- 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]
- Minimum prime number operations to convert A to B
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.