Explain bit-wise operators, C/C++ Programming

Assignment Help:

Bit-wise Operators

Some applications require operations to be done on dissimilar bits of a byte separately. Bit-wise operators offer a facility to do just that. There are various bit-wise operators:

Unary Operator: One's Complement Operator(')

This operator is a unary operator that causes the bits of its operand to be inverted, i.e. 1 become 0 and 0 becomes 1. For instance, to see the largest possible number, which can be kept in an unsigned integer, a zero can be assigned to it. All the bits in this word will be zeros. When the one's complement operator is used on this word, all the bits will be inverted to ones, giving the largest possible number. The program to show this conversion is below:

                main()

                 {

                  unsigned u = 0;

                                printf("Value before conversion : %d\n",u);

                                u = ~u;

                                printf("Value After conversion : %d\n",u);

                }

 


Related Discussions:- Explain bit-wise operators

Compiler design, Compiler Design - Limit In The Method Instructions

Compiler Design - Limit In The Method Instructions

System programing, #quesdifferentiate betweenrelocatable and self relocatin...

#quesdifferentiate betweenrelocatable and self relocating program with exampletion..

Assignment, Programming Assignment # 1 C and UNIX   The purpose of this ...

Programming Assignment # 1 C and UNIX   The purpose of this assignment is to get you more familiar with Unix/Linux and those constructs of C that are not part of C++. Write a C

#tit, Write a program to find the area under the curve y = f(x) between x =...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Compiler design limiting instruction, Ravi is a newbie to the programming a...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''{'''' and end with ''''}

Explain different implementations of oop, Different implementations of OOP ...

Different implementations of OOP Object-oriented programming is not mainly concerned with the details of the program operation. Instead, it deals with the overall design of the

Algorithm and flowchart, an algorithm and flowchart of finding the product ...

an algorithm and flowchart of finding the product of any two numbers

Programming and solving problems with a computer, One person who is special...

One person who is specialist at programming and solving problems with a computer Project Description: Potential computer, hardware, programming and software genius, I look

Verification class, I need help to understand and do this assignment ******...

I need help to understand and do this assignment ********************************************************* You are to insert the missing code in the C program given for combinatio

#pointers, what is the purpose of pointer ? what is the syntax? how it work...

what is the purpose of pointer ? what is the syntax? how it works?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd