1. Write a program in C to convert an unsigned number in an arbitrary base to a nonnegative decimal integer. For four-digit base 6 numbers, for example, declare const int base = 6; const int numDigits...

1. Write a program in C to convert an unsigned number in an arbitrary base to a nonnegative decimal integer. For four-digit base 6 numbers, for example, declare



const int base = 6;


const int numDigits = 4;


int number[numDigits];


Write the function


void getNumber(int num[])


to input the unsigned number in the arbitrary base. Use the uppercase letters of the alphabet


for input if required by the value of base. Write the function


int baseToDec(const int num[])


to convert the number in the arbitrary base to a nonnegative decimal value. You must be able


to modify your program for operation with a different base by changing only the constant base.


You must be able to modify the program for a different number of digits by changing only the


constant numDigits.














Nov 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here