by Dinesh Thakur Category: C Programming (Pratical)

In this program user ask to define the left shift operator. Left Shift Operator The left 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 c3 = c1<<2. 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.

# include<stdio.h>
void main()
{
    int c1 = 1,c3 = 3;
    clrscr();
    c3 = c1<<2;
    printf("\nLeft Shift by 2 Bits c1 << 2 = %d",c3);
    getch();
}
Left Shift Operator

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), 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.



Search Content