Задание 6.1
Запишите число, которое будет напечатано в результате выполнения следующей программы:
Паскаль:
| 1
2
3
4
5
6
7
8
9
10
11
 | var s, n: integer;
begin
s := 0;
n := 0;
while s <= 55 do
  begin
  s := s + 5;
  n := n + 2
  end;
write(n)
end. | 
var s, n: integer;
begin
s := 0;
n := 0;
while s <= 55 do
  begin
  s := s + 5;
  n := n + 2
  end;
write(n)
end.
| Бейсик: | DIM S, N AS INTEGER
S = 0
N = 0
WHILE S <= 55
  S = S + 5
  N = N + 2
WEND
PRINT N | 
 DIM S, N AS INTEGER
S = 0
N = 0
WHILE S <= 55
  S = S + 5
  N = N + 2
WEND
PRINT N | Python: | s = 0
n = 0
while s <= 55:
  s = s + 5
  n = n + 2
print(n) | 
 s = 0
n = 0
while s <= 55:
  s = s + 5
  n = n + 2
print(n) | С++: | #include <iostream>
using namespace std;
int main() {
int s = 0, n = 0;
while (s <= 55) {
  s = s + 5;
  n = n + 2;
}
cout << n << endl;
return 0;
} | 
 #include <iostream>
using namespace std;
int main() {
int s = 0, n = 0;
while (s <= 55) {
  s = s + 5;
  n = n + 2;
}
cout << n << endl;
return 0;
} | 
 
 
✍ Решение: 
Ответ: 24