My Cart
Your Cart 0

    Your cart is empty.

  • Total (Amount) ₹0.00
Previous year question hub

C Programming and Recursion - Programming and Data Structures - Computer Science & Information Technology Previous Year Questions

Practice C Programming and Recursion - Programming and Data Structures - Computer Science & Information Technology previous year questions organised from real papers, with year-wise coverage and clear topic navigation.

27Papers
17Years
85Questions
1Topics

C Programming and Recursion question pattern

Every graph below is calculated only from this selection.

Questions by year

Year-wise coverage for C Programming and Recursion. Each bar uses a separate theme-derived color.

Difficulty distribution

How the classified questions are distributed by difficulty.

Medium 48 56.5%
Easy 37 43.5%

Question type distribution

MCQ, numerical, multiple-select and other formats found in these papers.

MCQ 50 58.8%
Numerical Answer Type (NAT) 32 37.6%
MSQ 3 3.5%

Subject weightage

Top subjects by unique question coverage.

Computer Science & Information Technology
85 Qs

Most asked topics

Top topics across the included previous year papers.

Programming and Data Structures
85 Qs

Subtopic coverage

Top subtopics inside this exact selection.

C Programming and Recursion
85 Qs

Paper coverage

Question coverage for the most populated papers. Every active PYP paper remains listed below.

Computer Science and Information Technology (CS) 2026
4 Qs
Computer Science and Information Technology (CS) 2026
3 Qs
Computer Science & Information Technology (CS) 2025 [Session 2]
4 Qs
Computer Science & Information Technology (CS) 2025 [Session 1]
3 Qs
Computer Science & Information Technology (CS) 2024 [Session 2]
4 Qs
Computer Science & Information Technology (CS) 2024 [Session 1]
3 Qs
Computer Science & Information Technology (CS) 2023 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2022 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2021 [Session 2]
4 Qs
Computer Science & Information Technology (CS) 2021 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2020 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2019 [Session 2]
6 Qs
Computer Science & Information Technology (CS) 2018 [Session 2]
5 Qs
Computer Science & Information Technology (CS) 2017 [Session 2]
6 Qs
Computer Science & Information Technology (CS) 2016 [Session 2]
5 Qs
Computer Science & Information Technology (CS) 2016 [Session 1]
4 Qs
Computer Science & Information Technology (CS) 2014 [Session 2]
4 Qs
Computer Science & Information Technology (CS) 2014 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2014 [Session 3]
1 Qs
Computer Science & Information Technology (CS) 2013 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 3]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 4]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2010
3 Qs
Computer Science & Information Technology (CS) 2009
1 Qs
Computer Science & Information Technology (CS) 2008
6 Qs
Computer Science & Information Technology (CS) 2007
2 Qs

Included previous year papers

Newest papers appear first. Sort by year, question coverage or name.

PaperYear / sessionQuestions in this viewOpen
Computer Science and Information Technology (CS) 202620263View paper
Computer Science and Information Technology (CS) 202620264View paper
Computer Science & Information Technology (CS) 2025 [Session 1]20253View paper
Computer Science & Information Technology (CS) 2025 [Session 2]20254View paper
Computer Science & Information Technology (CS) 2024 [Session 1]20243View paper
Computer Science & Information Technology (CS) 2024 [Session 2]20244View paper
Computer Science & Information Technology (CS) 2023 [Session 2]20231View paper
Computer Science & Information Technology (CS) 2022 [Session 2]20223View paper
Computer Science & Information Technology (CS) 2021 [Session 1]20212View paper
Computer Science & Information Technology (CS) 2021 [Session 2]20214View paper
Computer Science & Information Technology (CS) 2020 [Session 2]20203View paper
Computer Science & Information Technology (CS) 2019 [Session 2]20196View paper
Computer Science & Information Technology (CS) 2018 [Session 2]20185View paper
Computer Science & Information Technology (CS) 2017 [Session 2]20176View paper
Computer Science & Information Technology (CS) 2016 [Session 1]20164View paper
Computer Science & Information Technology (CS) 2016 [Session 2]20165View paper
Computer Science & Information Technology (CS) 2014 [Session 1]20141View paper
Computer Science & Information Technology (CS) 2014 [Session 2]20144View paper
Computer Science & Information Technology (CS) 2014 [Session 3]20141View paper
Computer Science & Information Technology (CS) 2013 [Session 1]20132View paper
Computer Science & Information Technology (CS) 2013 [Session 2]20131View paper
Computer Science & Information Technology (CS) 2013 [Session 3]20132View paper
Computer Science & Information Technology (CS) 2013 [Session 4]20132View paper
Computer Science & Information Technology (CS) 201020103View paper
Computer Science & Information Technology (CS) 200920091View paper
Computer Science & Information Technology (CS) 200820086View paper
Computer Science & Information Technology (CS) 200720072View paper

All C Programming and Recursion previous year questions

Practice every matching question in batches of 20, with every available option.

1
2007 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2007
Consider the following segment of C-code:
int j, n;
j = 1;
while (j <= n)
    j = j*2;
The number of comparisons made in the execution of the loop for any \( n > 0 \) is:
Open complete paper
2
2007 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2007
Consider the following C function:
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;
}
What is the value of f(5)?
Open complete paper
3
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression?
\[ a = ( x > y ) ? ( ( x > z ) ? x : z ) : ( ( y > z ) ? y : z ) \]
Open complete paper
4
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
What is printed by the following C program?
int f(int x, int *py, int **ppz) { int y, z; **ppz += 1; z = *ppz; *py += 2; y = *py; x += 3; return x+y+z; } void main() { int c, *b, **a; c = 4; b = &c; a = &b; printf("%d", f(c, b, a)); }
Open complete paper
5
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
Choose the correct option to fill ?1 and ?2 so that the program below prints an input string in reverse order. Assume that the input string is terminated by a newline character.
void reverse(void) { int c; if(??1) reverse(); ??2 } main() { printf("Enter Text"); printf("\n"); reverse(); printf("\n"); }
Open complete paper
6
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order. What will be the contents of the list after the function completes execution?
struct node { int value; struct node *next; }; void rearrange(struct node *list) { struct node *p, *q; int temp; if ((!list) || (!list -> next)) return; p = list; q = list -> next; while (q) { temp = p -> value; p -> value = q -> value; q -> value = temp; p = q -> next; q = p ? p -> next : 0; } }
Open complete paper
7
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
f1(8) and f2(8) return the values
Open complete paper
8
2008 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2008
Statement for Linked Answer Questions 84 and 85:
Consider the following C program that attempts to locate an element x in an array Y[ ] using binary search. The program is erroneous.
1. f(int Y[10], int x) {
2. int i, j, k;
3. i = 0; j = 9;
4. do {
5. k = (i+j)/2;
6. if (Y[k] < x) i = k; else j = k;
7. } while ((Y[k] != x) && (i < j));
8. if (Y[k] == x) printf("x is in the array");
9. else printf("x is not in the array");
10. }
On which of the following contents of Y and x does the program fail?
Open complete paper
9
2009 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2009
Consider the program below:
#include <stdio.h> int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p = 1; return 1; } t = fun(n-1, f_p); f = t + *f_p; *f_p = t; return f; } int main() { int x = 15; printf("%d\n", fun(5, &x)); return 0; }The value printed is :
Open complete paper
10
2010 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2010
What does the following program print? #include <stdio.h> void f(int *p, int *q) { p = q; *p = 2; } int i=0, j=1; int main() { f(&i, &j); printf("%d %d\n", i, j); return 0; }
Open complete paper
11
2010 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2010
What is the value printed by the following C program?
#include <stdio.h> int f(int *a, int n) { if (n <= 0) return 0; else if (*a % 2 == 0) return *a + f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7, 13, 4, 11, 6}; printf("%d", f(a, 6)); return 0; }
Open complete paper
12
2010 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2010
The following program is to be tested for statement coverage:
begin
if (a == b) {S1; exit;}
else if (c == d) {S2;}
else {S3; exit;}
S4;
end
The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given.
T1: a, b, c and d are all equal
T2: a, b, c and d are all distinct
T3: a == b and c != d
T4: a != b and c == d
Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?
Open complete paper
13
2013 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2013 [Session 1]
What is the return value of f(p,p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value.
int f (int &x, int c) {
c = c - 1;
if (c==0) return 1;
x = x + 1;
return f(x,c) * x;
}
Open complete paper
14
2013 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2013 [Session 1]
If array A is made to hold the string “abcde”, which of the above four test cases will be successful in exposing the flaw in this procedure?
Open complete paper
15
2013 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2013 [Session 2]
What is the return value of f(p, p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value. int f (int &x, int c) { c = c - 1; if (c==0) return 1; x = x + 1; return f(x, c) * x; }
Open complete paper
16
2013 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2013 [Session 3]
What is the return value of f(p, p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value.
int f (int &x, int c) {
  c = c - 1;
  if (c==0) return 1;
  x = x + 1;
  return f(x, c) * x;
}
Open complete paper
17
2014 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2014 [Session 1]
Consider the following C function in which size is the number of elements in the array E:

int MyX(int *E, unsigned int size)
{
int Y = 0;
int Z;
int i, j, k;

for(i = 0; i < size; i++)
Y = Y + E[i];

for(i = 0; i < size; i++)
for(j = i; j < size; j++)
{
Z = 0;
for(k = i; k <= j; k++)
Z = Z + E[k];
if (Z > Y)
Y = Z;
}
return Y;
}

The value returned by the function MyX is the
Open complete paper
18
2014 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2014 [Session 2]
Suppose \(n\) and \(p\) are unsigned int variables in a C program. We wish to set \(p\) to \(^nC_3\). If \(n\) is large, which one of the following statements is most likely to set \(p\) correctly?
Open complete paper
19
2014 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2014 [Session 2]
For a C program accessing X[i][j][k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and the size of a character is 8 bits.t0 = i * 1024
t1 = j * 32
t2 = k * 4
t3 = t1 + t0
t4 = t3 + t2
t5 = X[t4]Which one of the following statements about the source code for the C program is CORRECT?
Open complete paper
20
2014 · Computer Science & Information Technology · Programming and Data Structures · C Programming and Recursion
Computer Science & Information Technology (CS) 2014 [Session 2]
Consider the following function\n\ndouble f(double x) {\n if( abs(x*x - 3) < 0.01) return x;\n else return f(x/2 + 1.5/x);\n}\n\nGive a value q (to 2 decimals) such that f(q) will return q: ____.
Open complete paper

Showing 20 of 79 questions