Question: Q 3 - 1 . Write a program to carry out the operations as specified below and show the results. I. Declare two int type

Q3-1. Write a program to carry out the operations as specified below and show the results. I. Declare two int type variables a and b. Set a =0x3 and b =0xC.
II. Perform BITWISE AND operation of a with b and print the result.
III. Perform LOGICAL AND operation of a with b and print the result.
IV. Explain the cause of the difference between the results of II and III.
V. Perform the logical NOT (!a) and bitwise NOT (~a) operations on a and print results for both operations. Explain the cause of the difference between the results of logical and bitwise NOT. Are logical and bitwise operators interchangeable ?

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!