| Other C Interview Questions |
| | | Question | Asked @ | Answers | | | | How to implement variable argument functions ? | HP | 1 | | who did come first hen or agg | Infosys | 12 | | Design a program using an array that searches a number if it
is found on the list of the given input numbers and locate
its exact location in the list. | | 3 | | what are brk, sbrk?
| Oracle | 1 | | How can I read a directory in a C program? | Wipro | 1 | | Hai why 'c' is the middle language | | 2 | | why should i select you? | Wipro | 18 | | Given a single Linked list with lakhs of nodes and length
unknown how do you optimally delete the nth element from the
list? | Oracle | 1 | | How can I invoke another program from within a C program? | | 6 | | what is the associativity of bitwise OR operator? | | 1 | | what is the output?
#define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t)
float gfloat;
main()
{
float a=1.12,b=3.14;
fun (a,b,float);
printf("na=%4.2f,b=%4.2f",a,b);
}
A)Error in Defining Macro
B)a=1.12,b=3.14
C)a=3.14,b=1.12
D)None of the Above
| Accenture | 2 | | What is meant by
int fun const(int a, int b) {
....
...
}
| | 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 | | 1,4,8,13,21,30,36,45,54,63,73,?,?. | Franklin-Templeton | 5 | | What is volatile in c language? | HCL | 1 | | n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}
| Wipro | 4 | | plz answer.... write a program that reads line (using
getline) e.g."345", converts each line to an integer
using "atoi" and computes the average of all the numbers
read. also compute the standard deviation. | | 1 | | how to connect oracle in C/C++. | | 2 | | What is C language Terminator? | TCS | 12 | | What is the most efficient way to count the number of bits
which are set in a value? | | 3 | | | | For more C Interview Questions Click Here |
|