Skip to content

Instantly share code, notes, and snippets.

@btechmag
Created April 15, 2021 14:55
Show Gist options
  • Save btechmag/167891c64ade11bc32daef5219d18ee2 to your computer and use it in GitHub Desktop.
Save btechmag/167891c64ade11bc32daef5219d18ee2 to your computer and use it in GitHub Desktop.
Program to read an integer from the keyboard and left shift the integer by two bits.
#include<stdio.h>
int main()
{
int x;
printf("Read the integer from keyboard: ");
scanf("%d", &x);
printf("Integer value = %d", x);
x <<= 2;
printf("The left shifted data is %d", x);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment