I am preparing for my exams and i just found this question from previous question papers:

Give the C Expression for the following algebric expression :

  1. ab^4c^2-d/m-n

  2. ab-[{(e+f)^9}/c}]

Please help me as i am preparing for my exams and haven't read this topic yet.

help plz

Recommended Answers

All 7 Replies

Is that ab^(4c^2-d/m-n) or ab^4c^(2-d/m-n) or ab^(4c^2)-d/m-n or ... or .. or ... or ...

There are a billion ways to interpret that.

Decomposed (first example ONLY):

ab := a*b
4c := 4*c

Using precidence:

2-d/m-n := 2 - (d/m) -n

Then key question is do the '^' operators in ab^4c^2-d/m-n mean XOR or power operations? They can be either. The results are radically (sic) different!

In any case, I think this is a really poorly stated expression. The professor should be seriously criticized for it... :-(

I would think ab^4c^2-d/m-n would be interpreted liks this: where ^ is power operation

a*(b^4)*(c^2)-(d/m)-n

In none of the math courses I took (or recall) did ^ represent bit operation. I only learned that when studying computer programming.

Thank You Everyone for your help ..... Thanks a lot ... Al answerd helped me to prepare for that... Thank you @iamthwee @ancientdragon @rubberman @moschops ...... But why you marked it as downpost ?

@Himanshu
Downpost? Probably because you were asking for help with school/homework/testing stuff and hadn't prepared yourself, likely by things like "reading the book" or participating in class assignments.

Member Avatar

One thing I'll add is your second expression is missing a curly bracket. Brackets/parentheses must match -I'm assuming this is a typo.

Simply use the rule of mathematics to figure out what you evaluate first. I doubt the symbol '^' represents the bitwise operator here and is more likely to be the power operator.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.