CIL MT · Computer Science

Programming in C/C++ Previous Year Questions

11 Programming in C/C++ (Computer Science) questions asked in CIL MT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 11 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which statement correctly defines the regular expressions? Statement-1: Regular expressions representation doesn’t involve a combination of strings of symbols from some alphabet ∑, parentheses and the operators +, ×, and *. Statement-2: A regular expression is not obtained from the symbol {a, b, c}, empty string ∈, and empty-set Φ perform the operations +, × and * (union, concatenation and Kleene star).
  1. AStatement-1 is True and Statement-2 is True
  2. BStatement-1 is False and Statement-2 is True
  3. CStatement-1 is False and Statement-2 is False
  4. DStatement-1 is True and Statement-2 is False
Show answerHide answer

Correct answer: (C) Statement-1 is False and Statement-2 is False

Q2CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Given a code snippet in C programming language as follows: int a = 10; int *p; int **w; p = &a; which statement correctly assigns the address of 'p' to 'w'?
  1. Aw = &p;
  2. Bw = p;
  3. Cw = &&a;
  4. Dw = *p;
Show answerHide answer

Correct answer: (A) w = &p;

Q3CIL MT Systems, 26 Mar 2017 (12:30 PM)
The output of the following 'C' language code is: void main(){ int x=1, i, y=2; for (i=0;i<10;i++) { x << 1; y=x+i; } printf("%d,%d",x,y); }
  1. A10,11
  2. B1,1
  3. C10,1
  4. D1,10
Show answerHide answer

Correct answer: (D) 1,10

Q4CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following is/are FALSE? I) Operator precedence parser works on ambiguous grammar II) Top-down parser works on left recursive, unambiguous and deterministic grammar III) LL(1) is a non-recursive descent parser IV) CLR(1) is the most powerful parser
  1. AOnly II
  2. BI, II, III and IV
  3. CII and IV
  4. DI, III and IV
Show answerHide answer

Correct answer: (A) Only II

Q5CIL MT Systems, 26 Mar 2017 (12:30 PM)
The number of tokens in the following 'C' language statement is: printf("The number of tokens are %d", &tcount);
  1. A8
  2. B9
  3. C10
  4. D11
Show answerHide answer

Correct answer: (A) 8

Q6CIL MT Systems, 26 Mar 2017 (12:30 PM)
The output of the following 'C' language code is: void main(){ char arr[10]; arr = "world"; printf("%s", arr); }
  1. Aworld
  2. Bworld5
  3. Cworld10
  4. DL-value required error
Show answerHide answer

Correct answer: (D) L-value required error

Q7CIL MT Systems, 26 Mar 2017 (12:30 PM)
What is the output when the following segment of 'C' code is executed? void main(){ float a = 123.456; printf("%7.2f, %7.3f, %12e", a, a, a); }
  1. A123.450, 123.4560, 1.234560e+02
  2. B123.46, 123.456, 1.234560e+02
  3. C123.456000, 123.456, 0.1234560e+03
  4. D123.45, 123.4560, 1.234560e+02
Show answerHide answer

Correct answer: (B) 123.46, 123.456, 1.234560e+02

Q8CIL MT Systems, 26 Mar 2017 (12:30 PM)
The default storage class for functions in 'C' language is:
  1. AStatic
  2. BRegister
  3. CExtern
  4. DAuto
Show answerHide answer

Correct answer: (C) Extern

Q9CIL MT Systems, 27 Feb 2020 (8:00 AM)
Find the output of the following #include <stdio.h> int main( ) { int x=5, y=9; x=(x= x+y)-(y= x-y); printf("%d %d ", x, y); return 0; }
  1. A5 14
  2. B5 9
  3. C14 5
  4. D9 5
Show answerHide answer

Correct answer: (D) 9 5

Q10CIL MT Systems, 27 Feb 2020 (8:00 AM)
What is the output of the following C program #include <stdio.h> int main( ) { int i=5; printf("%d %d %d", i++, i, ++i ); return 0; }
  1. A7 6 6
  2. B6 7 8
  3. C6 7 7
  4. D5 6 7
Show answerHide answer

Correct answer: (C) 6 7 7

Q11CIL MT Systems, 27 Feb 2020 (8:00 AM)
The class of Context-free grammar is not closed under _______ operations.
  1. AConcatenation
  2. BIntersection
  3. CStar
  4. DUnion
Show answerHide answer

Correct answer: (B) Intersection

How to use these CIL MT Computer Science questions

Every question here was asked in a real CIL MT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full CIL MT papers as timed tests to check your speed under exam conditions.

More CIL MT subjects