0
Question related to bitwise operator
How we enter...hexadecimal to scanf and.....find even odd using bitwise operator only
5 odpowiedzi
- 1
Quoted from http://www.cplusplus.com/reference/cstdio/scanf/
"Any number of hexadecimal digits (0-9,a-f,A-F), optionally preceded by 0x or 0X, and all optionally preceded by a sign (+or-)."
Don't worry, scanf will do the parsing of input, check whether the input has any hexadecimal digit, and make necessary adjustment on extracting the number.
But to be explicit on the hexadecimal input (as written on the link above), you can (optionally) use the 0x prefix, to tell scanf that the input was a hexadecimal value.
Hope it clears the doubt : )
+ 4
You mean to enter a hexadecimal value on a scanf prompt? if so, then you can use %x format specifier on scanf, for example:
scanf("%x", &i);
Assuming <i> was an integer type variable.
+ 1
Ipang..
.
if we use int data type then how we insert hexadecimal A,B,B5
Because these are also hexadecimal number , and we cant add character type in int data type
+ 1
Thnx a lot....
+ 1
RS STATUS CLUB
You're welcome, and please don't mark my answer, I think somebody might want to put a correction note on my answer, so I guess we'll wait for that ... : )