Q41.What would be the value of `s` at the end of the execution of the following pseudocode if the value of `n` is 1024?
The operator `//` returns the quotient and the operator `%` returns the remainder.
```
s = 0, r = 0, n = 1024
while(n > 0){
r = n % 10
s = s + r
n = n // 10
}
```
Save
Check
Details
Q41
16 Jul 2023
Q41.What would be the value of `s` at the end of the execution of the following pseudocode if the value of `n` is 1024?
The operator `//` returns the quotient and the operator `%` returns the remainder.
```
s = 0, r = 0, n = 1024
while(n > 0){
r = n % 10
s = s + r
n = n // 10
}
```