Чему будет равно значение переменной c в результате выполнения фрагмента программы
a:=1257; c:=0;
while a>0 do begin
if a mod 2<>0 then b:=a mod 10; c:=c+b;
a:=a div 10; end;
1) 5;
2) 13;
3) 16;
4) 18.
Ответы на вопрос
Ответил APALoff
0
Ответ: 18
Обоснование:
Var a,b,c : Integer;
Begin
a:=1257; c:=0;
while a>0 do begin
if a mod 2<>0 then b:=a mod 10; c:=c+b;
a:=a div 10; end;
Writeln(c);
end.
Обоснование:
Var a,b,c : Integer;
Begin
a:=1257; c:=0;
while a>0 do begin
if a mod 2<>0 then b:=a mod 10; c:=c+b;
a:=a div 10; end;
Writeln(c);
end.
Новые вопросы