Top

Discussion

What is the output of this C code?

#include 
    int main()
    {
        int var = 010;
        printf("%d", var);
    }

 

  • A.2
  • B.8
  • C.9
  • D.10

Answer: B

010 is octal representation of 8.

Output:
$ cc pgm4.c
$ a.out
8

No comment is present. Be the first to comment.
Loading…

Post your comment