ProAnswers.org

Write a C program to shift the input data by two bits right?

 #include<stdio.h>

#include<conio.h>

void main()

{

int x,y;

clrscr();

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

scanf(“%d”, &x);

x>>=2;

y=x;

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

getch();

}

Output:

Read the integer from keyboard(x): 8

The right shifted data is = 2