Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C++ code?
#include <stdio.h>
int main()
{
char a = ‘\012’;
printf(“%d”, a);
return 0;
}

What will be the output of the following C++ code?
#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.

Join The Discussion