1.
Wap to calculate the sum of even numbers from 20 to 40?
Answers
Answered by
0
Answer:
Ap = 22 , 24 , 26 ..... 38
- d = 2
- a = 22
an = a + (n -1)d
38 = 22 + (n - 1)2
16 = 2n - 2
2n = 18
- n = 9
Sn = n/2(2a + (n-1)d)
Sn = 9/2(44 + 16)
Sn = 9/2(60)
Sn = 9 × 30
Sn = 270
Answered by
0
sum =0;
for i from 20 to 40
If i%2 == 0
sum += i;
End if
End for
return sum;
for i from 20 to 40
If i%2 == 0
sum += i;
End if
End for
return sum;
Similar questions
English,
3 months ago
Hindi,
3 months ago
Physics,
6 months ago
English,
10 months ago
Environmental Sciences,
10 months ago