C | Variable Declaration and Scope | Question 7

filter_none

edit
close

play_arrow

link
brightness_4
code

int main()
{
  int x = 032;
  printf("%d", x);
  return 0;
}
chevron_right

(A) 32
(B) 0
(C) 26
(D) 50

Answer: (C)
Explanation: When a constant value starts with 0, it is considered as octal number. Therefore the value of x is 3*8 + 2 = 26
Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

Article Tags :
C
Practice Tags :