A program that read any octal number & display equivalent decimal number in Cpp.

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int n,a=0,i=1;
    clrscr();
    cout<<"Enter any octal number : ";
    cin>>n;
    while(n/10!=0)
    {
        a=a+i*(n%10);
        n=n/10;
    i=i*8;
    }
    a=a+i*(n%10);

    cout<<"Equivalent decimal number is :";
      cout<<a;
    getch();
}



////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........