#include <iostream>
      #include <cmath>
      
      using namespace std;
      int octalToDecimal(int octalNumber);
      // Function to convert octal number to decimal
      int octalToDecimal(int octalNumber)
      {
        int decimalNumber = 0, i = 0, rem;
        while (octalNumber != 0)
        {
          rem = octalNumber % 10;
          octalNumber /= 10;
          decimalNumber += rem * pow(8, i);
          ++i;
        }
        return decimalNumber;
      }
      

      Cpp language logo
      Octal to Decimal

      Codiga's C++ Recipes

      Convert octal number to decimal

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.