Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We know that operator is important. Because of that, we need to have a good understanding in it. Every operator will have precedence. To test

We know that operator is important. Because of that, we need to have a good understanding in it. Every operator will have precedence. To test your understanding about that, 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago