Why numbers starting from 0 is treated as octal in cpp?
For ex: int a=010; cout<<a; Outputs 8
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
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
Python palindrome challenge.
Number of Ones ( C++ ) question!