I have one long value and Set Particular bit by converting hexadecimal value.
long l = 4;
long output; //output is 84 if i want set 7th bit (1000 0100)
same way is long is 7 then output is 87 so how to set particular bit inside long value.
Requirement:
I have to send one byte to server by proper formatting.
Client gives following thing. 1. Whether 7th bit set or not set. 2. One integer value (like 4,5,6,7 etc.) Now I have generate string or decimal (2H) that format as client parameter.