C program for number system base convertor
Information: This program converts a user given number of any given base from 2 to 36 to any other base from 2 to 36 as per the user's wish.
Input:
-
It will ask what would you like to do from utility options (select 1 for base convertor).
-
Enter the number you want to convert.
-
Enter the base of the number you gave as input (base is from 2 to 36).
-
Enter the base to which you want the number to be converted to (It should be from 2 to 36).
-
It will give the answer.
-
If input number does not belong to the input base or the input base is out of range, program will get terminated.
Example:
//1// Hi! welcome to the utility app
What would you like to do (select choice) 1.Base convertor for base 2 to base 36: 1 Enter the positive number for conversion for base (2 to 36): 14B2.543 Enter the base of the input number: 13 Enter the target base: 9 The required answer is: 4123.361 //1//
//2// Hi! welcome to the utility app
What would you like to do (select choice) 1.Base convertor for base 2 to base 36: 1 Enter the positive number for conversion for base (2 to 36): 1B23.213 Enter the base of the input number: 2 Enter the target base: 11 Invalid input, program terminated //2//
Constraints:
-
The base should be from 2 to 36 (both included).
-
If the output goes beyond the capacity of long double capacity, wrong answer maybe produced