A
A
Alexander Timkov2017-11-16 15:59:50
Pascal
Alexander Timkov, 2017-11-16 15:59:50

How to write the sum of all three-digit numbers divided by 8.9?

I am learning Pascal. I can't understand
The task sounds like this:
Write a program that among all 3-digit numbers that are divisible by 8 and 9. The program should display the numbers satisfying the condition and their sum.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2017-11-16
@Tumkas

for i:= 100 to 999 do
begin
    if (i mod 8 = 0) or (i mod 9 = 0) then
    begin
        // Тут выводим, суммируем и т.д.
    end;
end;

A
Alexander, 2017-11-16
@NeiroNx

it is necessary to calculate the number itself and the sum of all numbers in the loop until the number is less than 1000
number=i*8*9 where i increases by 1 with each repetition of the loop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question