Assume that n and val are int variables. Also assume that the value of n is in the range 0 to 31, inclusive. Which of th

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Assume that n and val are int variables. Also assume that the value of n is in the range 0 to 31, inclusive. Which of th

Post by answerhappygod »

Assume that n and val are int variables. Also assume that thevalue of n is in the range 0 to 31, inclusive. Which of thefollowing statements sets bit n of val to 0, while leaving theother bits of val unchanged?
Choice 1 of 4: val = (val >> n) << n;Choice 2of 4: val = val | (1 << n);Choice 3 of 4: val = val^ (1 << n);Choice 4 of 4: val = val & ~(1 <<n);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply