Circular Rotation bitwise by 'N' position .
The below program helps in circular rotation of bits by N position leftwise .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ManualResetEvent_
{
class Number
{
public static void Main()
{
byte b1=circular_list(154,2);
Console.WriteLine(b1);
Console.ReadLine();
}
public static byte circular_list(byte a, byte b)
{
return (byte) ( a << b | a >> (8 - b ));
}
}
}
Comments
Post a Comment