1) C test -10 questions- Some questions were as follows, remember only a few.
a) What is the parameter passing mechanism to Macros Called?
b) void func(int x,int y)
{ x=3; y=2; }
main()
{ int i; func(i,i); print(i); }
If the output must be 2 what is the parameter passing mechanism called?
c) which of the following code will swap the two numbers? -3 choices was given
d) which of the following is illegal for the program?
main()
{ char const *p='p'; }
1)p++ 2) *p++ 3)(*p)++ 4) all
e) what is the output of the following program
void print(int ** arr)
{ print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]); }
main()
{ int a[][]={ {1,2,3}, {4,5,6} ** arr=a; print(arr); arr++; print(arr); }
f) which of the following code swaps the two numbers.
- 4 choices were given
g) if the string " this is a " is present in the code of a function such as 'void func(void)' where will
the variable stored in the memory.
a) in the stack
b) heap
c) code or text segment as per implementation
d) created when func is called, stored in function stack space and destroyed as it goes out .
2) CSE01-15 questions
My Quote