Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Manipulate means like doin right shift or AND or OR operation n finally to display it .Can u please tell one program .
Posted
Updated 19-Apr-12 21:48pm
v2

1 solution

Right shift: >>
Left Shift:  <<
AND:         &
OR:          |
XOR:         ^

A very simple Google would have found you this. See MSDN Operators[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.



"May i know how to declare this binary num also"

All numbers are binary numbers in the final analysis - all of the above work fine on byte, int and long datatypes.
If yopu are trying to specify a number in binary in your C# code, then you can't: the C# language specification only allows Decimal and Hexadecimal numbers. Hex is the normal way to enter them:
C#
int i = 0x5F;
if the equivalent of
C#
int i = 95;
or (if it worked in C#, which it doesn't)
C#
int i = 0b1011111;
 
Share this answer
 
v2
Comments
Rahul_Chand 20-Apr-12 3:30am    
May i know how to declare this binary num also
OriginalGriff 20-Apr-12 4:08am    
Answer updated
DominicZA 20-Apr-12 3:38am    
5 - Cant get much more simpler that that!
Rahul_Chand 20-Apr-12 3:50am    
WHAT ARE THE DATA TYPE TO DECLARE IT
OriginalGriff 20-Apr-12 4:01am    
Don't shout - it's rude.
Have a little patience - it takes time for emails to get around, and you are not the only call on my time...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900