Monday, January 4, 2010

Program to shift inputed data by two bits to the left.


#include
#include

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

No comments:

Post a Comment