program SumOddDigits;
varnum, digit, sum: integer;
beginsum := 0;
writeln('Enter a positive integer: ');readln(num);
while num > 0 dobegindigit := num mod 10;if digit mod 2 <> 0 thensum := sum + digit;num := num div 10;end;
writeln('The sum of odd digits is: ', sum);
end.
program SumOddDigits;
var
num, digit, sum: integer;
begin
sum := 0;
writeln('Enter a positive integer: ');
readln(num);
while num > 0 do
begin
digit := num mod 10;
if digit mod 2 <> 0 then
sum := sum + digit;
num := num div 10;
end;
writeln('The sum of odd digits is: ', sum);
end.