Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C | Data Types | Question 4

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Predict the output of following C program




#include <stdio.h>
int main()
{
    char a = 012;
  
    printf("%d", a);
  
    return 0;
}

(A) Compiler Error
(B) 12
(C) 10
(D) Empty


Answer: (C)

Explanation: The value ‘\012’ means the character with value 12 in octal, which is decimal 10.
Note: It is equivalent to char a = 012 and int a = ‘\012’ and int a = 012.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 24 Sep, 2020
Like Article
Save Article
Similar Reads