➽ Program:-

#include<iostream>

using namespace std;

int main()

{       

    int decimal_number, octal_number = 0, i = 1;

    cout << "Enter the Decimal Number: ";

    cin >> decimal_number;

 

    while(decimal_number != 0)

    {

        octal_number += (decimal_number % 8) * i;

        decimal_number /= 8;

        i *= 10;

    }

 

    cout << "Octal value is " << octal_number;

    return 0;

}

➽ Output:-

Enter the Decimal Number: 92
Octal value is 134