program DecimalToOctal;
vardecimalNum, quotient, remainder, i: Integer;octalNum: String;
begin// Input decimal numberwrite('Enter a decimal number: ');readln(decimalNum);
// Initialize variablesquotient := decimalNum;octalNum := '';i := 1;
// Convert decimal to octalrepeatremainder := quotient mod 8;octalNum := IntToStr(remainder) + octalNum;quotient := quotient div 8;until quotient = 0;
// Output the octal numberwriteln('Octal equivalent: ', octalNum);end.
program DecimalToOctal;
var
decimalNum, quotient, remainder, i: Integer;
octalNum: String;
begin
// Input decimal number
write('Enter a decimal number: ');
readln(decimalNum);
// Initialize variables
quotient := decimalNum;
octalNum := '';
i := 1;
// Convert decimal to octal
repeat
remainder := quotient mod 8;
octalNum := IntToStr(remainder) + octalNum;
quotient := quotient div 8;
until quotient = 0;
// Output the octal number
writeln('Octal equivalent: ', octalNum);
end.