//Program to covert octal to decimal equivalent.
# include <iostream>
# include <cmath>
using namespace std;
int main()
{
int octaltodecimal(int);
int num;
cout<<"ENTER A NUMBER(OCTAL):"<<endl;
cin>>num;
cout<<"DECIMAL EQUIVALENT IS:"<<octaltodecimal(num);
}
int octaltodecimal(int num)
{
int count=0,i,n,l,m,sum=0;
n=num;
while(num)
{
num=num/10;
count++;
}
m=count;
while(n)
{
l=n%10;
sum=sum+(l*pow(8,count-m));
m--;
n=n/10;
}
return sum;
}
OUTPUT