C programming

Report
Question

Please briefly explain why you feel this question should be reported .

Report
Cancel

Comment on the output of this C code?

#include <stdio.h>

int main()
{

int ThisIsVariableName = 12;

int ThisIsVariablename = 14;

printf(“%d”, ThisIsVariablename);

return 0;
}

1. The program will print 12

2. The program will print 14

3.The program will have a runtime error

4.The program will cause a compile-time error due to redeclaration

in progress 0
C Koutheesh (Admin) 2 years 2 Answers 435 views 0

Answers ( 2 )

  1. Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    ans:4.it causes compilation error of redeclaration
    we can assign only one value to a variable.
    here they define the variable two times

  2. Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    this program causes a compilation error ..because we are defining two values for same variable.
    here variable is ThisIsVariableName ,we are assigning two values (12,14) to the same .

Leave an answer

Browse

Captcha Click on image to update the captcha .