# Thread: How to solve expressions like this

1. ## How to solve expressions like this

c= (a,b)+(b,c)-(a,b)*(c,b);
if a,b,c are respectively 1,2,3

2. What is the comma suppose to do here? Is this a algebraic expression?

If so you could just do:

c= (a*b)+(b*c)-(a*b)*(c*b);

3. Yes this is an algebric expression if it was like (a*b) i know how to solve that
but dunno how to solve expressions involvins commas

4. I dont think I really understand your question

3 = (1,2) + (2,3) - (1,2) * (3,2) ?

are you asking how to solve this problem in general or in c?

5. the complete problem is like this
Code:
```void main()
{
int a=1,b=2,c=3,d=4,e;
e=(a,a)+(b,c)+(c,d)-(d,b);
printf("%d",e);
}```

compiler is giving the output but i just want to know how it is being interpreted by compiler

hope u understand my program now

6. That doesn't make a whole lot of sense to do, but out of the ordered pairs, only the second value will impact the result.

7. Originally Posted by whiteflags
That doesn't make a whole lot of sense to do, but out of the ordered pairs, only the second value will impact the result.
Yeah, the output give the same result as:

e=a+c+d-b;

8. Originally Posted by whiteflags
That doesn't make a whole lot of sense to do, but out of the ordered pairs, only the second value will impact the result.
thats why i asked this question it was given in a test of some software company, there were many others ques like this