Webpage

Programming in C. Recursion.

$$\scriptsize{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}\hline \textbf{Year}& \textbf{2026 - 1}& \textbf{2026 - 2}& \textbf{2025 - 1}& \textbf{2025 - 2}& \textbf{2024 - 1}& \textbf{2024 - 2}& \textbf{2023}& \textbf{2022}& \textbf{2021 - 1}& \textbf{2021 - 2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}\\\hline \textbf{1 Mark Count}&0&0&1&2&2&2&1&1&0&2&0&1.1&2\\\hline \textbf{2 Marks Count}&0&0&2&2&1&1&0&2&2&2&0&1.2&2\\\hline \textbf{Total Marks}&0&0&5&6&4&4&1&5&4&6&\bf{0}&\bf{3.5}&\bf{6}\\\hline \end{array}}}$$

Recent questions in Programming

2 2 votes
1 1 answer
221
221 views
#include <stdio.h int main() { double x = 9.0; double result; result = sqrt(x); printf("%f\n", result); return 0; } A) It prints 3.000000 B) It prints 0.000000 C) Behavio...
3 3 votes
1 1 answer
173
173 views
What is the output of the below code snippet?for var1, var2 in (1,2),(3,4): print(var1 + var2, end = " ")(a) 4 6(b) 10(c) 3 7(d) TypeError
0 0 votes
1 1 answer
165
165 views
What is the output of the below code snippet?result = 0 list1 = [10,20,30] list2 = [1,2] for num in range(len(list1)): for num in range(len(list2)): result += list1[num] ...
0 0 votes
1 1 answer
146
146 views
What is the output of the below code snippet?def move(list1, list2): for num in list1: list2.append(num) list1.remove(num) list1 = [1,2,3,4,5] list2 = [10] move(list1, li...
0 0 votes
0 0 answers
194
194 views
What will be output ?#include <stdio.h>int main() { int a=5,b=10; if(a<++a||b<++b) printf("%d %d",a,b); else printf("Pankan sharma"); return 0;}A) 5 10B) 6...
7 7 votes
2 2 answers
401
401 views
What is the output given exp = 4?switch (exp){ default: printf("default\n"); case 5: printf("5\n"); case 3: printf("3\n"); case 2: ...
13 13 votes
1 1 answer
1.1k
1.1k views
Assume:$\texttt{short = 2 bytes}$, $\texttt{int = 4 bytes}$, $\texttt{char = 1 byte}$$\texttt{int}$ needs $4$-byte alignment and the final structure size is rounded to a ...
14 14 votes
2 2 answers
584
584 views
Assume:struct Student { double gpa; }; struct Student alice; struct Student *sptr = &alice;Which of the following correctly assigns $\texttt{4.0}$ to $\texttt{alice.gpa}$...
9 9 votes
1 1 answer
442
442 views
Consider the following code idea from the source:typedef struct { double x, y; } Point; void reset(Point p) { p.x = p.y = 0; } int main() { Point a = {12.0, 42.0}; Point ...
6 6 votes
1 1 answer
425
425 views
What is printed by the following program?#include <stdio.h struct Student { int id, year; char grade; }; int main() { struct Student s; s.id = 10001; s.year = 2010; s.gra...
8 8 votes
1 1 answer
392
392 views
Which option correctly completes the given exercise?#include <stdio.h /* define the person struct here using the typedef syntax */ int main() { person john; john.name = "...
5 5 votes
1 1 answer
370
370 views
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r4 = virfib_sq(4)What would be the outp...
3 3 votes
1 1 answer
203
203 views
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r3 = virfib_sq(3)What would Python disp...
2 2 votes
1 1 answer
166
166 views
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r2 = virfib_sq(2)What would be the outp...
2 2 votes
1 1 answer
170
170 views
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r1 = virfib_sq(1)What would be the outp...
1 1 vote
1 1 answer
191
191 views
Consider the following Python code:def virfib_sq(n): print(n) if n <= 1: return n return (virfib_sq(n - 1) + virfib_sq(n - 2)) 2 r0 = virfib_sq(0)What would be the outp...
11 11 votes
2 2 answers
456
456 views
What is the output of the following code?#include <stdio.h void func(int a, int *bptr) { a = 42; *bptr = 42; return; } int main(void) { int x = 100, y = 100; func(x, &y);...
11 11 votes
3 3 answers
460
460 views
Consider the macro:#define square(x) (x*x)Now consider the statement:c = square(a + b);After macro expansion, which expression is produced?$\texttt{c = ((a + b) * (a + b)...
7 7 votes
3 3 answers
407
407 views
What does the following code do?#include <stdio.h int main() { char c; while ((c = getchar()) != EOF) { if (c >= 'A' && c <= 'Z') c = c - 'A' + 'a'; putchar(c); } return ...
9 9 votes
2 2 answers
377
377 views
Consider the following program:#include <stdio.h int main(void) { char ch; printf("Enter your input: "); while ((ch = getchar()) != 'C') { putchar(ch); } return 0; }For t...