Programming - C Language - Recursion
GATE CSE & IT · 2 questions across 2 years (2024-2025) · 5% recurrence rate
Recurrence sparkline
2024–202520242025
Difficulty mix
med 100%
Question types
NAT1
MCQ1
All 2 questions on Programming - C Language - Recursion
2025 Q61
#include int foo(int S[],int size) { if(size == 0) return 0; if(size == 1) return 1; if(S[0] != S[1]) return 1+foo(S+1,size-1); return foo(S+1,size-1); } int main() { int A[]={0,1,2,2,2,0,0,1,1}; printf("%d",foo(A,9)); r...
Med✓
2024 Q19
Consider the following C program: #include void fX(); int main() { fX(); return 0;} void fX() { char a; if((a=getchar()) != '\n') fX(); if (a != '\n') putchar (a); } Assume that the input to the program from the command...
Med✓