a
Middle
School
Grade 6
Grade 7
Grade 8
Grade 9
Ressource
Out Middle
High
School
Grade 10
Grade 11
Grade 11 - STMG
Grade 12 - STMG
Grade 12
Grade 12 - Comp.
Grade 12 - Exp.
Ressource
Out High
4
3
2
1
Outside the middle school program
/ A few algorithms
3 exercises (100% corrected)
a
Algorithm and AlgoBox
(3 exercices)
A
et
B
deux nombres
Le
reste
de
la
division
de
A
par
B
vaut 0?
Le PGCD est
B
ˆ
A
prend pour valeur
B
ˆ
B
prend pour valeur
r
On e∑ectue la division euclidienne de
A
par
B
Oui
Non
A
B
C
D
1
D
2
1.
A
lgorithm
and
A
lgoBox
E.3392
1
In
the
programming
language
of
y
our
c
hoice,
en
ter
the
function
b
elo
w
:
Function
f(a)
For
i
ranging
from
1
to
100
c
←
remainder
of
the
division
euclidean
of
a
by
b
End
For
2
Running
a
step-b
y-step
execution
of
the
function
f
with
the
argumen
t
b
=
3
,
what
are
the
v
alues
assigned
to
the
v
ariable
c
.
E.3390
The
program
b
elo
w
represen
ts
the
P
GC
D
algorithm
b
y
successiv
e
subtraction
for
AlgoBo
x
soft-
w
are.
Function
f(a,b)
As
long
as
a
−
b
=
0
M
←
max(a;b)
b
←
min(a;
b)
a
←
M
c
←
a
−
b
a
←
c
End
As
long
as
1
W
rite
this
program
in
the
language
of
y
our
c
hoice.
2
Call
the
function
f
with
the
v
alues
a
=
541
and
b
=
24
.
When
calling
this
function
f
step
b
y
step
in
the
algo-
rithm,
note
the
v
alues
of
the
v
ariables
a
,
b
and
c
at
eac
h
end
of
lo
op
execution.
E.3391
Here
is
a
diagram
sho
wing
Euclid’s
al-
gorithm
:
1
In
the
table
b
elo
w,
determine
the
GC
D
of
the
n
um
b
ers
541
and
24
:
A
B
r
2
Hier
ist
eine
Sc
hreib
w
eise
dieses
Algorithm
us
durc
h
die
F
unktion
f
,
die
zw
ei
natürlic
he
Zahlen
als
Argumen
te
nimm
t.
Function
f(a,b)
While
...
r
←
remainder
of
the
Euclidean
division
of
a
and
b
a
←
...
b
←
...
End
While
r
←
0
Return
b
Complete
the
missing
parts
of
this
algorithm.
h
ttps:/
/c
hingmath.fr
chapExoCorrec/3392
sacados/3392
chapExoCorrec/3390
sacados/3390
chapExoCorrec/3391
sacados/3391
A
et
B
deux nombres
Le
reste
de
la
division
de
A
par
B
vaut 0?
Le PGCD est
B
ˆ
A
prend pour valeur
B
ˆ
B
prend pour valeur
r
On e∑ectue la division euclidienne de
A
par
B
Oui
Non
A
B
C
D
1
D
2
ChingMath
by ChingLab
©
Middle School
Grade 6
Grade 7
Grade 8
Grade 9
High School
Grade 10
Grade 11
Grade 12
Grade 12 opt. Complémentaire
Grade 12 opt. Experte
Various
Contact me
F.A.Q
Other website
ChingWeb