1. pointer # include "stdio. H"
# Include "conio. H"
# Include "string. H"
Void main ()
{
Int I, Radix;
Long N;
Char A [33];
Void trans10_2_8_16 (char * P, long M, int base );
Printf ("\ ninput Radix (2, 8, 16 ):");
Scanf ("% d", & Radix );
Printf ("\ ninput a positive integer :");
Scanf ("% lD", & N );
Trans10_2_8_16 (A, N, Radix );
For (I = strlen (a)-1; I> = 0; I --)
Printf ("% C", * (a + I ));
Puts ("\ n ");
Getch ();
}
Void trans10_2_8_16 (char * P, long M, int Base)
{
Int R;
While (M> 0)
{
R = m % base;
If (r <10) * P = R + 48;
Else * P = R + 55;
M = m/base;
P ++;
}
* P = '\ 0 ';
}
2. The parameters are arrays # include "stdio. H"
# Include "conio. H"
# Include "string. H"
Void main ()
{
Int I, Radix;
Long N;
Char A [33];
Void trans10_2_8_16 (char a [], long M, int base );
Printf ("\ ninput Radix (2, 8, 16 ):");
Scanf ("% d", & Radix );
Printf ("\ ninput a positive integer :");
Scanf ("% lD", & N );
Trans10_2_8_16 (A, N, Radix );
For (I = strlen (a)-1; I> = 0; I --)
Printf ("% C", * (a + I ));
Puts ("\ n ");
Getch ();
}
Void trans10_2_8_16 (char a [], long M, int Base)
{
Int R;
While (M> 0)
{
R = m % base;
If (r <10) * A = R + 48;
Else * A = R + 55;
M = m/base;
A ++;
}
* A = '\ 0 ';
}