InterviewSolution
Saved Bookmarks
| 1. |
Please Explain The Output Of The Code Provided Below And Explain The Reasoning ? $a = 012; Echo $a / 4; |
|
Answer» The answer is 2.5. In PHP, whenever a number is prefixed with 0, it will be considered as an OCTAL number, and hence the 012 octal number is equivalent to the decimal number 10, and so 10/4 is 2.5 The answer is 2.5. In PHP, whenever a number is prefixed with 0, it will be considered as an octal number, and hence the 012 octal number is equivalent to the decimal number 10, and so 10/4 is 2.5 |
|