Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  1
Language: C/C++
Code:

          Var a: array[1..100] of real;

i, n: integer;

s,sred: real;

Begin

Write (‘n=’); Readln (n);

s:=0;

For i:=1 to n do

begin

write (‘введите число’); readln (a[i]);

if i mod 2 = 0 then s:=s+a[i];

end;

writeln(‘сумма элементов с четными номерами: ‘,s);

End.
Comments: