# GATE CSE 2003

 Question 1
Consider the following C function.

float f(float x, int y)
{
float p, s; int i;
for (s=1, p=1, i=1; i < y; i ++)
{
p*= x/i;
s+=p;
}
return s;
}  
For large values of y, the return value of the function f best approximates
 A $x^{y}$ B $e^{x}$ C ln(1+x) D $x^{x}$
C Programming   Loop
Question 1 Explanation:
 Question 2
Assume the following C variable declaration
int *A [10], B[10][10];
Of the following expressions
I A[2]
II A[2][3]
III B[1]
IV B[2][3]
which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
 A I, II, and IV only B II, III, and IV only C II and IV only D IV only
C Programming   Array and Pointer
Question 2 Explanation:

 Question 3
Let P(E) denote the probability of the event E. Given P(A) = 1, P(B) = 1/2, the values of P(A|B) and P(B|A) respectively are
 A 1/4,1/2 B 1/2, 1/14 C 1/2, 1 D 1, 1/2
Discrete Mathematics   Probability Theory
Question 3 Explanation:
 Question 4
Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are there such that
(i) each is sorted in ascending order,
(ii) B has 5 and C has 3 elements, and
(iii) the result of merging B and C gives A?
 A 2 B 30 C 56 D 256
Discrete Mathematics   Combination
Question 4 Explanation:
 Question 5
n couples are invited to a party with the condition that every husband should be accompanied by his wife. However, a wife need not be accompanied by her husband. The number of different gatherings possible at the party is
 A $\binom{2n}{n}*2^{n}$ B $3^{n}$ C $\frac{(2n)!}{2^{n}}$ D $\binom{2n}{n}$
Discrete Mathematics   Combination
Question 5 Explanation:

There are 5 questions to complete.