Storage
class interview questions in c programming
1. What is problem in following code?
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;
10. Why we use register variable in c?
9 comments:
how to find the answer?
printf("%%%%");
output is %%
can anyone explain the reason for it........
@rashi %% is used to print a single % in printf
hence %%%% print 2 units of %.
can u print tayyab khan in form of star
what are storage classes and its ise?
storage class define the scope, life and in which segment the variable is actually stored in the main memory is defined by the storage class.
variables of auto storage class is strored in stack segment.
variables of register storage class are stored in cpu registers.
unintialized static and global variables are stored in BSS(block started by symbols ) segment and the initialized global and static variables are stored in data segment.
Q9 was a excellent question.
void main(){
extern int i;
printf(“%d”,i);
}
int i=6;
answer:6
there is no problem in this questionn...
% acts as the delimiter
Post a Comment