+ 1
Why this code generate f
int main () { int a=15; cout <<hex <<a; } ..Output is.. f Why this code generate f and why not other?
4 Antworten
+ 3
It's the value of a in hexadecimal
+ 3
std::hex modifies the default base for numeric I/O. So the value 15 is printed in hexadecimal, which is "f".
+ 1
Nom Butt The question has already been answered. f is 15 in hexadecimal notation
https://en.m.wikipedia.org/wiki/Hexadecimal
0
Anna ?