Computer Science, asked by kartikeanuj, 1 month ago


N-base notation is a system for writing numbers that use only n different
symbols, This symbols are the first n symbols from the given
notation list(including the symbol foro) Decimal ton base notation are (0:0, 1:1,
2:2, 3:3, 4:4, 5.5, 6:6, 7:7, 8:8, 99, 10:A11 B and so on up to 35.2)
Implement the following function
Char* DectoNBase(int n, int num:
The function accepts positive integer in and num Implement the function to
calculate the n-base equivalent of num and return the same as a string
Steps:
1. Divide the decimal number by n, Treat the division as the integer division
2. Write the remainder in n base notation)
3. Divide the quotient again by n, Treat the division as integer division
4. Repeat step 2 and 3 until the quotient is o
5. The n-base value is the sequence of the remainders from last to first
Assumption
1 <n< = 36
Example
Input
n. 12
Provide
num 718
Output
4BA,​

Answers

Answered by Prettyboy1231
4

Answer:

N-base notation is a system for writing numbers which uses only n different symbols. These symbols are the first n symbols from the given notation list (including the symbol for 0). Decimal to n-base notations are {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B and so on up to 35:Z).

Similar questions