[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Basics

Home > Programs > Basics

107 / 279

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: