Predict the output of following program.
The program prints 10. Putting a 0 before an integer constant makes it an octal number and putting 0x (or 0X) makes it a hexadecimal number. It is easy to put a 0 by accident, or as a habit. The mistake is very common with beginners.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- GFact 22 | (2^x + 1 and Prime)
- GFact 23 | (Brocard’s problem)
- 10 Web Development and Web Design Facts That You Should Know
- What is Cicada 3301?
- Interesting and Cool Tricks in Java
- How to Install and Configure MongoDB in Ubuntu?
- Interesting Facts About Perl
- 10 Interesting Facts About Computers
- Interesting Facts about DBMS
- Can C++ reference member be declared without being initialized with declaration?
- Facts and Question related to Style of writing programs in C/C++
- Dilworth's Theorem
- Storage of integer and character values in C
- Vantieghems Theorem for Primality Test
- Cauchy's Mean Value Theorem