Storage class interview questions in c

Storage class interview questions in c programming


1. What is problem in following code?
void main(){
    int a=5;
static int i=a+5;
printf(“%d”,i);
}
2. Tell any five properties of auto variables?
3.
What is problem in following code?
void main(){
    register a,b,sum;
scanf(“%d%d”,&a,&b);
sum=a+b;
printf(“%d”,sum);
}
4. Can we declare same variables in two times globally?
5. Tell me something about extern variables.
6. What is difference between auto and static storage class?
8. What is data and code area of data segment?
9. What is problem in the following code?
void main(){
    extern int i;
    printf(“%d”,i);
}
int i=6;
Post a Comment