GATE c programming

Set-15 C-Programming Gate 2005

C-Programming |Gate-2005| previous year questions| Set-15

C-Programming |Gate-2005| 1. What does the following C-statement declare? int ( * f) (int * ) ; [GATE – 2005] a. A function that takes an integer pointer as argument and returns an integer.b. A function that takes an integer as argument and returns an integer pointer.c. A pointer to a function that takes an integer pointer as …

C-Programming |Gate-2005| previous year questions| Set-15 Read More »

Set-15 C-Programming Gate 2005

C-Programming |Gate-2006| previous year questions| Set-14

C-Programming |Gate-2006| 1. Consider this C code to swap two integers and these five statements after it: void swap(int *px, int *py) {    *px = *px – *py;    *py = *px + *py;    *px = *py – *px; } S1: will generate a compilation error S2: may generate a segmentation fault at runtime depending on the arguments passed S3: …

C-Programming |Gate-2006| previous year questions| Set-14 Read More »

Set-15 C-Programming Gate 2005

C-Programming |Gate-2007| previous year questions| Set-13

C-Programming |Gate-2007| 1. Consider the following C function, what is the output? [GATE – 2007] #include <stdio.h> int f(int n) {     static int r = 0;     if (n <= 0) return 1;     if (n > 3)     {         r = n;         return f(n-2)+2;     }     return f(n-1)+r; } int main() {     printf(“%d”, f(5)); } a. 5b. 7c. 9d. 18 Answer : d) 2. The function f is defined …

C-Programming |Gate-2007| previous year questions| Set-13 Read More »

previous year question of ALGORITHMS gate 1993

ALGORITHMS |Gate-1994| Previous Year Questions| Set-14

ALGORITHMS |Gate-1994| FORTRAN implementation do not permit recursion because : [GATE – 1994] a. they use static allocation for variablesb. they use dynamic allocation for variablesc. stacks are not available on all machinesd. it is not possible to implement recursion on all machines Answer : a) The recurrence relation that arises in relation with the …

ALGORITHMS |Gate-1994| Previous Year Questions| Set-14 Read More »

previous year question of ALGORITHMS gate 1993

ALGORITHMS |Gate-1995| Previous Year Questions| Set-13

ALGORITHMS |Gate-1995| Merge sort uses : [GATE – 1995] a. Divide and conquer strategyb. Backtracking approachc. Heuristic searchd. Heuristic search Answer : a) For merging two sorted lists of sizes m and n into a sorted list of size m+n, we required comparisons of : [GATE – 1995] a. O(m)b. O(n)c. O(m+n)d. O(logm+logn) Answer : c) …

ALGORITHMS |Gate-1995| Previous Year Questions| Set-13 Read More »