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()
{
int ThisIsVariableName = 12;
int ThisIsVariablename = 14;
printf(“%d”, ThisIsVariablename);
return 0;
}

What will be the output of the following C code?
#include <stdio.h>
int main()
{
int ThisIsVariableName = 12;
int ThisIsVariablename = 14;
printf(“%d”, ThisIsVariablename);
return 0;
}
a) The program will print 14
b) The program will print 12
c) The program will have a runtime error
d) The program will cause a compile-time error due to redeclaration

Answer: a
Explanation: Variable names ThisIsVariablename and ThisIsVariableName are both distinct as C is case sensitive.
So, Output is 14

Join The Discussion