1. Engineering
  2. Computer Science
  3. in definition octal literal can only contain 07 however in...

Question: in definition octal literal can only contain 07 however in...

Question details

Integers that begin with 0 are consider as octal and can only have digits 0-7. Integers that begin with 0x or 0X are consider as hexadecimal . All other types of integers are considered as decimal Step 2 Consider the following variable initialization int month 9, day-7; In this initialization, two integer variables month and day are initialized with decimal integer literals. Step 3 int month 09, day -07; In this initialization, two integer variables Chapter 2 Problem 6E
In definition, octal literal can only contain 0-7. However, in step 3, the answer said month=09 is also initializing month as octal. Is the answer wrong or I misunderstand the definition? I get day=07 is initialized octal but 9 is greater than 7, it should not be an octave literal based on definition. Please help.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution