Answer the question
In order to leave comments, you need to log in
Pascal ABC - how to do it?
The user enters an array of real numbers, the size of a one-dimensional array is given by a constant .
You need to determine how many numbers in the array are non-integer.
Answer the question
In order to leave comments, you need to log in
const N = 5;
var
i, j, s: Integer;
nums: array[1..N] of Real;
begin
for i := 1 to N do begin
ReadLn(nums[i]);
end;
s := 0;
for j := 1 to N do begin
if Frac(nums[j]) <> 0 then begin
s := s + 1;
end;
end;
WriteLn(s);
end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question