- #1
courtrigrad
- 1,236
- 2
Hello all
Given the code:
Find a and b. SO this is what I did:
0 = 0 + 2 (value of a)
2 = 2 + 0 + 1 (value of b)
Now a = 2 and b = 3, and we work from those values until we get to the constraints. However I am not sure whether this is correct?
Any help and tips is appreciated!
Thanks
Given the code:
Code:
int a = 0;
int b = 0;
for(a = 0; a < 10 && b < 20; a = a+2) {
a = a + b;
b = b + a + 1;
}
Find a and b. SO this is what I did:
0 = 0 + 2 (value of a)
2 = 2 + 0 + 1 (value of b)
Now a = 2 and b = 3, and we work from those values until we get to the constraints. However I am not sure whether this is correct?
Any help and tips is appreciated!
Thanks