You are on page 1of 1

Function coba(a:integer):string

b:integer
str:string
if(a=0) then
coba :=
else
b := a mod 2
if (b=0) then str:= 0
else str := 1
coba := coba (a div 2) + str
COBA(155)

Procedure KRTI(krinteger)
If(k>1) then
If k mod 2 = 0 then KRTI(k div 2)
Else
KRTI(3*k + 1)
If k mod 5 = 1 then write (K)
If k mod 5 = 2 then write (R)
If k mod 5 = 3 then write (T)
If k mod 5 = 4 then write (I)
KRTI(20)?

You might also like