by Dinesh Thakur Category: C Programming (Pratical)

In this program user ask to define the left shift operator. Left Shift Operator The right operands value is moved left by the number of bits specified by the right operand. User declares required variables for storing the value. User put a condition to shift the bits from Right to left. Display result on the screen.

Problem Statement:
This is C Program that ask user to define a left shift operator with use of Logic.

  1. Declare variable.
  2. Using Method.
  3. Display result on the Screen.

Here is C source code for define the left shift bit wise operator. Output of this program shown below. 

void main()
    unsigned int Value=4;          /*  4 = 0000 0100 */
    unsigned int Shift=2;
    Value = Value << Shift;        /* 16 = 0001 0000 */
    Value <<= Shift;               /* 64 = 0100 0000 */
    printf("Shifting Bits Left = %d\n", Value);         /* Prints 64      */

 Operators can be Used for Shifting Bits Left

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.