C++ Programming Code Examples C++ > Conversions Code Examples Convert Octal number to Decimal number Convert Octal number to Decimal number To convert octal number to decimal number in C++ programming, you have to ask to the user to enter the octal number to convert it into decimal number to display the equivalent value in decimal format as shown here in the following program. Following C++ program ask to the user to enter any octal number to convert it into decimal, then display the result on the screen : #include<iostream.h> #include<conio.h> #include<math.h> void main() { clrscr(); long int octnum, decnum=0; int i=0; cout<<"Enter any Octal Number : "; cin>>octnum; while(octnum!=0) { decnum = decnum + (octnum%10) * pow(8, i); i++; octnum=octnum/10; } cout<<"Equivalent Decimal Value = "<<decnum; getch(); }