The name of your C program file must be called todec1.c, files with any other name will not be marked.
After this, write a program to convert a base-n number to its equivalent base-10 (decimal) number, where 2 <= n <= 9.
2 0 2 1 2 11 2 01010101 2 111101000 2 111111111 8 0 8 1 8 11 8 0123 8 70523164 5 0440321 9 888888888We will of course test your programs with different test data.
Look at the sample run below and use your inference and deductive skills to figure out the format of the text file as well as the data it contains.
$ gcc -Wall todec1.c -o todec1 $ ./todec1 0 in base 2 has decimal value of 0. 1 in base 2 has decimal value of 1. 11 in base 2 has decimal value of 3. 1010101 in base 2 has decimal value of 85. 111101000 in base 2 has decimal value of 488. 111111111 in base 2 has decimal value of 511. 0 in base 8 has decimal value of 0. 1 in base 8 has decimal value of 1. 11 in base 8 has decimal value of 9. 123 in base 8 has decimal value of 83. 70523164 in base 8 has decimal value of 14853748. 440321 in base 5 has decimal value of 15086. 888888888 in base 9 has decimal value of 387420488. $
A total of 8 different hosts have accessed this document in the last 445 days; your host, nsrp-source.comp.nus.edu.sg, has accessed it 7 times.
If you're interested, complete statistics for this document are also available, including breakdowns by top-level domain, host name, and date.