Vidyalelo
C Programming · Q47

C Fundamentals

Programming · C Programming · question 47

Q47

Find the output of the following program. void main() int i=01289; printf("%d", i);

A.
0289
B.
1289
C.
713
D.
0713
E.
Syntax error
Answer

Answer: Option E

Solution

Answer: Option E
Solution:

The prefix 0 in an integer value indicates octal value. In octal value use of 8 and 9 is not allowed and hence the error.