Home » C Programming » Variables » Question
  1. What would be the output of following program ?
    int x = 15;
    main()
    {
    int x = 60;
    print("\n%d", x);
    }
    1. Error
    2. 15
    3. 60
    4. Garbage value
Correct Option: C

Whenever there is a conflict between local and global variable, the local variable wins. So In this question local variable gets priority over global.



Your comments will be displayed only after manual approval.