In the series of Number System Conversion, today I am going to share another c program which will convert the decimal number to octal number using c programming language with an example with the output.
Copy the below c program and execute it with the help c compiler. Below program will take input as a decimal number and convert into the octal number.
void dec_oct(long int num) // Function Definition
long int rem,i=0,length=0;
printf("nOctal number : ");
long int num;
printf("Enter the decimal number : ");
dec_oct(num); // Calling function
Enter the decimal number : 20
Octal number : 24
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: binary to decimal conversion program, c program to convert binary to octal, c program to convert decimal to octal, c programs, c programs with solutions, decimal to octal conversion, list of important c programs, number conversion program, Number System Conversion, octal number conversion