program DecimalToOctal;
varnum, octalNum: Integer;
procedure DecimalToOctal(num: Integer);beginif num < 8 thenWrite(num)elsebeginDecimalToOctal(num div 8);Write(num mod 8);end;end;
beginWrite('Enter a decimal number: ');Readln(num);
Write('Octal equivalent: ');DecimalToOctal(num);Writeln;end.
program DecimalToOctal;
var
num, octalNum: Integer;
procedure DecimalToOctal(num: Integer);
begin
if num < 8 then
Write(num)
else
begin
DecimalToOctal(num div 8);
Write(num mod 8);
end;
end;
begin
Write('Enter a decimal number: ');
Readln(num);
Write('Octal equivalent: ');
DecimalToOctal(num);
Writeln;
end.