GATE Programming and Data Structures: Programming in C – Previous Year Questions
41 GATE previous year questions on Programming in C (Programming and Data Structures, Computer Science) with answers and explanations, from every paper.
- GATE 2017 CS Q23 – Consider the following C code: The code suffers from which one of the following problems:
- GATE 2017 CS Q63 – Consider the following C program. Recall that `strlen` is defined in `string.h` as returning a value of type `size t`, which is an `unsigned int`. The…
- GATE 2017 CS Q65 – The output of executing the following C program is .
- GATE 2016 CS Q22 – Consider the following C program. Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?
- GATE 2016 CS Q25 – Consider the following C program. The output of the program is .
- GATE 2016 CS Q46 – What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed?
- GATE 2015 CS Q16 – Match the following: (P) Condition coverage (Q) Equivalence class partitioning (R) Volume testing (S) Alpha testing (i) Black-box testing (ii) System…
- GATE 2015 CS Q34 – The output of the following C program is .
- GATE 2015 CS Q38 – Consider the following C program segment. The cyclomatic complexity of the program segment is .
- GATE 2015 CS Q62 – What is the output of the following C code? Assume that the address of x is 2000 (in decimal) and an integer requires four bytes of memory.
- GATE 2015 CS Q65 – Consider the following pseudo code, where x and y are positive integers. The post condition that needs to be satisfied after the program terminates is
- GATE 2018 CS Q12 – Consider the following C program. The output of this program is:
- GATE 2018 CS Q39 – Consider the following C program: The output of the program above is
- GATE 2018 CS Q42 – Consider the following C code. Assume that `unsigned long int` type length is 64 bits. The value returned when we call `fun` with the input 240 is
- GATE 2019 CS Q28 – Consider the following C program: The value printed by the program is .
- GATE 2019 CS Q37 – Consider the following C program: Which one of the following values will be displayed on execution of the programs?
- GATE 2019 CS Q62 – Consider the following C program: The number of times the variable sum will be printed, when the above program is executed, is .
- GATE 2019 CS Q63 – Consider the following C program: The output of the above C program is .
- GATE 2026 CS (CS2) Q17 – In the C runtime environment, which one of the following is stored in the heap?
- GATE 2026 CS (CS2) Q19 – Consider the following three ANSI C programs, P1, P2, and P3. Which one of the following statements is true?
- GATE 2026 CS (CS2) Q60 – Consider the following ANSI C program. The output of this program is . (answer in integer) Note: Assume that the program compiles and runs…
- GATE 2026 CS (CS1) Q34 – Consider the following program in C: The output of the program is . (answer in integer)
- GATE 2025 CS (CS2) Q19 – Consider the following C program: Which ONE of the following will be the output of the program?
- GATE 2025 CS (CS2) Q33 – The output of the given C code segment is . (Answer in integer)
- GATE 2025 CS (CS2) Q62 – Consider the following C program: The output of the above program is . (Answer in integer)
- GATE 2025 CS (CS2) Q63 – Consider the following C program: The output of the given C program is . (Answer in integer)
- GATE 2025 CS (CS1) Q34 – The output of the given C program is . (Answer in integer)
- GATE 2025 CS (CS1) Q63 – Consider the following C program: The value printed by the given C program is . (Answer in integer)
- GATE 2024 CS (CS2) Q13 – Consider the following C program. Assume parameters to a function are evaluated from right to left. Which one of the following options is the CORRECT…
- GATE 2024 CS (CS2) Q33 – Consider the following C function definition. Which of the following statements is/are TRUE?
- GATE 2024 CS (CS2) Q36 – What is the output of the following C program?
- GATE 2024 CS (CS1) Q18 – Consider the following C program: Which one of the following statements is CORRECT?
- GATE 2024 CS (CS1) Q48 – Consider the C function: Which of the following statements is/are TRUE about the above function?
- GATE 2023 CS Q35 – The integer value printed by the ANSI-C program given below is .
- GATE 2022 CS Q21 – What is printed by the following ANSI C program?
- GATE 2022 CS Q43 – What is printed by the following ANSI C program?
- GATE 2022 CS Q44 – What is printed by the following ANSI C program? ASCII: A–Z = 65–90, a–z = 97–122, '*' = 42, '+' = 43, '−' = 45.
- GATE 2021 CS Q47 – Consider the following ANSI C program. Which one of the following options is correct?
- GATE 2021 CS Q58 – Consider the following ANSI C function: Let Z be an array of 10 elements with Z[i]=1, for all i such that 0 i 9. The value returned by…
- GATE 2020 CS Q32 – Consider the following C program. The output of the program is .
- GATE 2020 CS Q58 – Consider the following C functions. The value returned by pp(3,4) is .