+ 3
Why numbers starting from 0 is treated as octal in cpp?
For ex: int a=010; cout<<a; Outputs 8
1 Answer
+ 9
Such prefix are used for integer literals, to signal the intended base for the integer literal. There are some well known integer literal prefix commonly used. Among which are:
0b - Prefix for binary integer literal
0 - Prefix for octal integer literal
0x - Prefix for hexadecimal integer literal
Learn more about integer literals, prefix and suffix here 👇
https://www.tutorialspoint.com/cprogramming/c_constants.htm
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
2 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes