C Programming Interview Questions

C Programming Interview Questions

C programming Interview Questions and Answers

These following basic level C Programming Interview questions are useful for exams and interview preparation.Questions covers the topics from basic of C,control statements,pointers,arrays,file handling,structures.

1)what is the output of this program?

#include<stdio.h>

main()

{

int a=5,b=6,c=7;

printf(“%d”,a&b&c);

}

Ans:4

2)what is the output of this program?

main()

{

int a=5,b=6,c=7;

printf(“%d”,a|b&c);

}

Ans:7

3)what is the output of this program?

main()

{

int a=5,b=6,c=7,d;

d=printf(“%d %d %d “,a,b,c);

printf(“%d”,d);

}

Ans:5 676

4)what is the output of this program?

main()

{

int s;

s=printf(“hello”);

printf(“%d”,s);

}

Ans: hello5

5)what is the output of this program?

main()

{

int s=5,t;

clrscr();

t=(s++)+(++s);

printf(“%d”,t);

}

Ans: 12

6)what is the output of this program?

main()

{

char s=’s’,t;

clrscr();

t=s-32;

printf(“%c”,t);

}

Ans: S

Pages 1 2 3 4 5 6 7 8

Share