write the output..........
Attachments:
Answers
Answered by
2
- Write the output of the given code.
At first, S=0 and C=5
Now,
S=S+C
Or,
S=0+5=5.
Now,
C=C+3
Or,
C=8.
Now,
C<=10 is true since 8<=10
Now, we will go to line number 30.
So,
S=S+C
Or,
S=5+8=13
Now,
C=C+3
Or,
C=8+3=11
Now, C<=10 is false.
So,
If statement will not execute.
Now, the print statement gets executed.
So,
Sum = 13.
Now, the program terminates.
Sum=13.
At first,
P=1
K=9
Now, K is printed.
9 is printed.
P=P*K=9
K=K-4=5
Now,
K>=3 is true.
So, we will shift to line 30.
Again, P=P*K
=9*5=45.
K=K-4=1.
Now, if part will not execute.
So, We will print P.
45 is printed.
9
45
Similar questions