provide answer of the problem in c programming it is related to bitwise opertor?

-4

Write a short function called halfmask as follows:

unsigned int halfmask(unsigned int i); This function sets to 0 all the bits of i except the least significant 16 bits and returns the updated value of i. The least significant 16 bits are untouched.

For example, if this is called as halfmask(0xffffffff) it should return 0xffff (i.e. 65535), and if it is called as thirdbit(0x11111) it should return 0x1111 (i.e. 4369).

Also, your submission should contain just this function and nothing else.

c
bitmap
asked on Stack Overflow Jul 20, 2020 by Searcher

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0