Header Ad

C Program to shift input data by two bits to the left

In this tutorial, we are going to write a C Program to shift input data by two bits to the left in C Programming with practical program code and step-by-step full complete explanation.

C Program to shift input data by two bits to the left


C Program to shift input data by two bits to the left.

#include<stdio.h>
#include<conio.h>

void main()
{
	int x,y;

	clrscr();

	printf("Read the integer from keyboard :- ");

	scanf("%d",&x);
	x<<=3;
	y=x;

	printf("\nThe left shifted data is = %d",y);

	getch();
}


Output

Read the integer from keyboard :- 2
The left shifted data is 16


Post a Comment

0 Comments