Assume that x is a variable that has been declared as an int and been given a value. Assume that twice is a function that receives a single integer paramter and returns twice its value. (So if you pass 7 to twice it will return 14. Thus the expression twice(7) has the value 14.
Write an expression whose value is eight times that of x without using the standard C arithmetic operators (*,+, etc.). Instead, use calls to twice to accomplish this.
In this exercise you must write this as a single expression-- you must not write any statements. Also, you may only use the twice() function-- no other functions or operators.
I tried a few codes example as
But I can't get it to work. I'm only suppose to write a small code and not a actual whole code. If someone can give me some tips or some sort that would be great. Thanks in advance.
Write an expression whose value is eight times that of x without using the standard C arithmetic operators (*,+, etc.). Instead, use calls to twice to accomplish this.
In this exercise you must write this as a single expression-- you must not write any statements. Also, you may only use the twice() function-- no other functions or operators.
I tried a few codes example as
Code:
twice(twice x,twice x)
Comment