Professional Documents
Culture Documents
C Interview Questions and Answers: What Will Be The Result of The Following Code?
C Interview Questions and Answers: What Will Be The Result of The Following Code?
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
}
Answer: 12 , 13 , 13
[C Frequently
}
Answer: 11, 16
}
Answer: Two lines with Tech Preparation will be printed.
}
if (a==0){
//do something
}
if (a===0){
//do something
}
What are x, y, y, u
#define Atype int*
typedef int *p;
p x, z;
Atype y, u;
Answer: x and z are pointers to int. y is a pointer to int but u is just an integer
variable