Solution LARP Lab 02
Solution LARP Lab 02
Note: Problems difficulty level is gradually increasing. If any problem seems very easy or you have already
did it in LARP, move to next problem:
1. Input 2 numbers and print numbers between them
read n1
read n2
for i=n1 to n2 step 1 do
write i
endfor
2. Input n (number). Print all numbers divisible by n from 50 to 200
read n
for i=50 to 200 step 1 do
if i%n=0 then
write i
endif
endfor
4. Compute and print sum of 50 to 100 odd numbers & even numbers and print them
sumO=0
sumE=0
for i=50 to 100 step 1 do
if i%2=0 then
sumE=sumE+i
else
sumO=sumO+i
endif
endfor
write "Sum of even numbers from 50-100 is:", sumE
write "Sum of odd numbers from 50-100 is:", sumO