I need to add a to b and b to a. I've been looking everywhere can this be accomplished with enum or structs?

two values are used to calculate each other
e.g a = b + c
b = a + d
this is called a circular reference.

Run this and tell me it's not working...

``````int a, b, c, d;
a = 10;
b = 15;
c = 12;
d = 14;

a = b + c;
b = a + d;

Response.Write("value of a : " + a + "<br />");
Response.Write("value of b : " + b + "<br />");``````

you see, a should use b's final answer and b should use a's final answer.

my b is using a's final answer..
could you be kind to run this code..
and setup a debug...and see the values..

a = 27
b = 41

you assigned 15 to b and 12 to c = 27
I need the e.g(41) for b

dude B is returning 41...
i'm not sure wot is your problem..?

wot should be your expected output..
after my calculation..

wot do u expect the value a & b?

a = 27
b = 41

the calculation should then be
a = 41 + 12
b = 27 + 14

no it's not gonna happen
cos you are changing the B's value after a's calculation..

``````int a, b, c, d;
a = 10;
b = 15;
c = 12;
d = 14;

a = b + c;
b = a + d;
[B] a = b + c;[/B]

Response.Write("value of a : " + a + "<br />");
Response.Write("value of b : " + b + "<br />");``````