| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Difference between fopen() and open()? | Aricent | 3 |
| what is the difference between #include<> and #include”…”? | | 1 |
| How does free() know how many bytes to free? | | 5 |
| What are bit fields? What is their use? | Adobe | 1 |
| 18)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
19) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1
());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
20)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
| | 1 |
| Why cann't whole array can be passed to function as value. | | 1 |
| sir,
i cannot find the way how to write aprogram by using
array on queue | IISIT | 1 |
| What is an object?
| | 3 |
| Which of these statements are false w.r.t File Functions?
i)fputs() ii)fdopen() iii)fgetpos() iv)ferror()
A)ii B)i,ii C)iii D)iv
| Accenture | 5 |
| Write a program to exchange two variaables without temp | Geometric-Software | 6 |
| What is structure padding ? | HP | 2 |
| What does the message "warning: macro replacement within a
string literal" mean? | | 1 |
| What are .h files and what should I put in them? | | 3 |
| main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
what is the output? | Ramco | 4 |
| What's wrong with "char *p; *p = malloc(10);"? | | 5 |
| how to create c progarm without void main()? | | 1 |
| write a program to sort the elements in a given array in c
language | | 2 |
| What is Heap? | | 3 |
| what is the output of the following program?
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);
} | | 7 |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 9 |
| |
| For more C Interview Questions Click Here |