int n;
scanf("%c ",& amparr);
n = arr-' 0 '; This will be converted into 10, and converted into binary to get octal and hexadecimal.