Question: C programming language. You will be given several operators and you need to output it from the operator with highest precedence until operator with the

C programming language.

You will be given several operators and you need to output it from the operator with highest precedence until operator with the lowest precedence.

Format Input: There will be T test cases. In each test case, there will be 3 different operators separated by a blank space. You may assume that the operator will be one of these : "&" (bitwise AND), "^" (bitwise XOR), "%" (remainder) , "|" (bitwise OR), "!" (logical NOT).

Format Output: In each test case, you need to output number of case followed by operator from the operator with highest precedence until operator with the lowest precedence.

Constraints: 1 <= T <= 100

Sample Input | Sample Output

3

& ^ % | Case #1: % & ^

& ^ ! | Case #2: ! & ^

& ^ ! | Case #3: ! & ^

Note: The precedence of the operators (from the highest to the lowest) are "!" (logical NOT), "%" (remainder), "&" (bitwise AND), "^" (bitwise XOR), , "|" (bitwise OR).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!