Computer Science, asked by janhavishh, 4 months ago

write an algorithm to display numbers from 40 to 30

Answers

Answered by akshaya2442
1

Explanation:

i

We can start off by initializing 2 integer variables, ‘a’ and ‘sum’.

Let a = 1

Let sum = 0

.

for(i = 1; i <= 50; i++):

sum += i;!

Let i = 50

Let sum = 0

sum += i⋅ (i+1)2i⋅ (i+1)2;

return sum;

Let i = 50 (terminal value)

Let s = 1 (starting value)

m = i2i2

sum += (i+s)⋅ m(i+s)⋅ m

return sum;

Similar questions