C Interview Questions 1-10

Hi friends, When i tried to get a job, Maximum I was rejected because of "C" questions. After i completed some interviews, I read lot of "Aptitute Questions based on C". I posted here all the objective type c qustions What i have now. It may helpful to clear your interview for next level. It contains c aptitude, c quiz, c object type of questions. Try to learn c to get good "CODING" life.

1-10 Questions

Q1:
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}
Answer:
0 0 1 3 1

Q2:
main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}
Answer :
three

Q3:
main()
{
printf("%x",-1<<4);
}
Answer:
fff0

Q4:
main()
{
int c=- -2;
printf("c=%d",c);
}
Answer:
c=2;

Q5:
main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
}
Answer: i=0

Q6:
main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
Answer:
hai

Q7:
main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}
Answer:
45545

Q8:
main()
{
printf("%p",main);
}
Answer:
Some address will be printed

Q9:
main()
{
int i=400,j=300;
printf("%d..%d");
}
Answer:
400..300

Q10:
void main()
{
int i=5;
printf("%d",i++ + ++i);
}
Answer:
Output Cannot be predicted exactly.

Comments are closed.