进制转换
使用递归实现不同进制间的转换
写一个名为to_base_n(int intNumber,int theBase)的函数,它接受2个参数,第一个参数intNumber是一个十进制整数;第二个参数theBase在2-16范围内,代表数字的基数,例如,2是二进制,8是八进制。
函数应将第一个参数的数字打印到第二个参数给定的基数上。例如,to_base_n(129,8)将显示201,即以8为基数的十进制整数129。
编写main()函数并在完整的程序中测试该函数。
(提示:可以使用递归函数/递归函数。)
/*
Name:programme3.c
Author:祁麟
Copyright:BJTU | school of software
Date:2020/10/31
Description:The program takes 2 parameters, the first parameter intNumber is a
decimal integer; and the second parameter theBase is in the range 2-16
which represent the base of number, for example, 2 is binary and 8 is octal.
*/
#include <stdio.h