In: Computer Science
n following code if variable n=0, a=5 and b=10 then what will be the value of variable ‘n’ after while loop executed. Show your working as well.
while(n<=(a^b)) { n++; } printf("%d",n)
___________________________________________________________________
while(n<=9765625){
n++;
}
Iteration No | Initial value of n | Final value of n |
1 | 0 | 1 |
2 | 1 | 2 |
3 | 2 | 3 |
4 | 3 | 4 |
... | ... | ... |
9765624 | 9765623 | 9765624 |
9765625 | 9765624 | 9765625 |
9765626 | 9765625 | 9765626 |
printf("%d",n)
___________________________________________________________________
Note: If you have
queries or confusion regarding this question, please leave a
comment. I would be happy to help you. If you find it to be useful,
please upvote.