72. Write a program in C to convert an unsigned number in an arbitrary base to a...

Question:

72. 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems

ISBN: 9781284079630

5th Edition

Authors: J Stanley Warford

Question Posted: