CPP Program convert octal to binary
In this example, you will learn about the conversion of octal to binary number in the cpp programming language .you must have knowledge about the following topics to understand the working of the program. Cpp while loop Cpp input method Cpp output method Following is the code of conversion. Code: #include <iostream> #include <cmath> using namespace std; int main() { int octalNumber,original; cout << "Enter an octal number: "; cin >> octalNumber; original=octalNumber; int decimalNumber = 0, i = 0; long long binaryNumber = 0; while(octalNumber != 0) { decimalNumber += (octalNumber%10) * pow(8,i); ++i; octalNumber/=10; } i = 1; while (decimalNumber != 0) { binaryNumber += (decimalNumber % 2) * i; ...