#include<stdio.h> #include<math.h> int main(){ long int octal,decimal =0; int i=0; printf("Enter any octal number: "); scanf("%ld",&octal); while(octal!=0){ decimal = decimal + (octal % 10) * pow(8,i++); octal = octal/10; } printf("Equivalent decimal value: %ld",decimal); return 0; }
Filled Under
C
C code to convert octal number to decimal number
Related:

C code for product of two binary numbers

C code for sum of two binary numbers:

How to convert large binary number to hexadecimal

C code for binary to decimal conversion

C code for how to convert large binary to octal

C program to convert binary to octal

C program for hexadecimal to binary conversion

C program to change octal to decimal
Subscribe to:
Post Comments (Atom)