Wednesday 13 March 2013

different variable scope


#include<stdio.h>
int xyz=10;
int main(){
    int xyz=20;
    printf("%d",xyz);
    return 0;
}

output: 20

Explanation: Two variables can have same name in different scope.


Blog Author: Vijay Kumar

Go to: Java Aptitude

No comments:

Post a Comment