First Upload
This commit is contained in:
21
13 - Bits/ex2.c
Normal file
21
13 - Bits/ex2.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "PointersLibs.h"
|
||||
|
||||
int RotateLeft(unsigned int num, int count)
|
||||
{
|
||||
unsigned short counter;
|
||||
unsigned int temp;
|
||||
for (counter = ZERO; counter < count; counter++)
|
||||
{
|
||||
temp = (num >> ((sizeof(num) * EIGHT) - ONE));
|
||||
num <<= ONE;
|
||||
num |= temp;
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
unsigned int x = 1000000000;
|
||||
printf("%u\n", RotateLeft(x,30));
|
||||
}
|
||||
Reference in New Issue
Block a user