ProAnswers.org

Write a C program to shift the input data by three bits left ?

#include

#include 

void main() 

{ 

int x,y; 

clrscr(); 

printf(“Read the integer from keyboard(x):”); 

scanf(“%d”, &x); 

x<<=3; 

y=x;                                                                             

printf(“The right shifted data is =%d”, y); 

getch(); 

} 

Output: 

Read the integer from keyboard(x): 2 

The right shifted data is = 16