Computer Science, asked by khalil0123456789, 4 months ago

What will be the output if the given code is executed?
N = 1
S = 0
WHILE N <= 5
S = S + N
N = N + 1
WEND
PRINT S​

Answers

Answered by mohammadadnan7
5

Answer:

the answer is 15

if my answer is correct thank me and mark me brainly and also rate me according to my answer.

as N= 1;

s= 0;

s= 0+1

s= 1;

as N=2;

s= 1;

s= 1+ 2;

s= 3;

as N= 3

s= 3;

s= 3+3;

s=6;

as N= 4;

s= 6;

s= 6+4;

s= 10;

as N= 5;

s= 10;

s= 10+5;

s=15;

and if it N= 6 ;

the while loop condition is false and loop terminate .

please thank me .if my answer is correct

Similar questions