Declarations and Initializations

Q1:
What will be the output of the program?
#include<stdio.h>
int X=40;
int main()
{
    int X=20;
    printf('%d\n', X);
    return 0;
}

A 20

B 40

C Error

D No Output

ANS:A - 20

Whenever there is conflict between a local variable and global variable, the local variable gets priority.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.