/* QUESTION 3 */
#include <stdio.h>
#include <conio.h>
void octal (int val, int rem);
int main ()
{
int num;
clrscr ();
printf ("From Decimal: ");
scanf ("%d", &num);
printf ("\nTo Octal: ");
octal (num, num);
getch ();
return (0);
}
void octal (int val, int rem)
{
if (rem == 0)
return;
rem = val % 8;
val = val / 8;
octal (val, rem);
if (rem != 0)
{
printf ("%d", rem);
}
}
I have done this so far but now I'm not getting how to convert the octal into binary... Please help me out with code ASAP... All is to be done through recursion...
Regards,
Linkpedia's Admin
www.linkpedia.co.nr
Admin Edit: Please use code tags when posting your code. Code tags are used like so =>
Thanks,
PsychoCoder

New Topic/Question
Reply




MultiQuote




|