program SumOfDigits;
varnumber, sum, digit: integer;
beginnumber := 1234;sum := 0;
while number > 0 dobegindigit := number mod 10;sum := sum + digit;number := number div 10;end;
writeln('Сумма цифр числа 1234 равна ', sum);end.
program SumOfDigits;
var
number, sum, digit: integer;
begin
number := 1234;
sum := 0;
while number > 0 do
begin
digit := number mod 10;
sum := sum + digit;
number := number div 10;
end;
writeln('Сумма цифр числа 1234 равна ', sum);
end.