Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Program Discussion :: Basics

Home > Programs > Basics

24 / 259

lets 32bit no. write a program to circular rotate 1 byte.
int y=0x01020304;
output y=0x04010203;

Answer:

#include

#include
using namespace std;
#define INT_BITS 32
int leftRotate(int n, unsigned int d)
{
return (n > (INT_BITS - d));
}
int rightRotate(int n, unsigned int d)
{
return (n >> d)|(n 

Asked In :: Alcatel-Lucent

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here: