Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

loops

GATE CSE & IT · Data Structures · 2000-2025

14
PYQs
71%
keyed
2
elite explanations
10
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2025 Q63

Consider the following C program: #include int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>=t) t *= 10; t /=10; while (t>0) { d = n/t; n = n%t; t /= 10;...

mediumanswer key
2025 PYQ

Consider the following C program : #include int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>= t) t*= 10; t/=10; while (t>0) { d=n/t; n=n%t; t/= 10; if (...

mediumbasic explanation
2024 PYQ

Consider the following C program: #include &ltstdio.h> int main() { int a = 6; int b = 0; while(a Which one of the following statements is CORRECT?

easyanswer keyelite explanation
2023 PYQ

Consider functions Function_1 and Function_2 expressed in pseudocode as follows: Function 1 while n > 1 do for i = 1 to n do x = x + 1; end for n = n/2; end while Function 2 for...

easyanswer keyelite explanation
2022 PYQ

What is printed by the following ANSI C program? #include <stdio.h> int main(int argc, char *argv[ ]) { int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, 13, 14, 15, 16,...

easyanswer keybasic explanation
2021 PYQ

Consider the following ANSI C function: int SimpleFunction (int y[], int n, int x) { int total = y[0], loopIndex; for (loopIndex = 1; loopIndex <= n - 1; loopIndex ++ ) total = x *...

easybasic explanation
2019 PYQ

Consider the following C program: #include < stdio.h > int main() { int a[] = {2, 4, 6, 8, 10} ; int i, sum = 0, *b = a + 4 ; for (i = 0; i < 5; i++) sum = sum + (*b - i) - *(b - i...

easybasic explanation
2019 PYQ

Consider the following C program : #include<stdio.h> int r() { static int num=7; return num--; } int main() { for(r();r();r()) printf("%od ",r()); return 0; } Which one of the foll...

mediumanswer keybasic explanation
2019 PYQ

Consider the following C program : #include <stdio.h> int main(){ float sum = 0.0, j = 1.0, i = 2.0; while (i/j > 0.0625){ j = j + j; sum = sum + i/j; printf("%f\n", sum); } return...

easybasic explanation
2018 PYQ

Consider the following C code. Assume that unsigned long int type length is 64 bits. unsigned long int fun(unsigned long int n){ unsigned long int i, j = 0, sum = 0; for (i = n; i...

easyanswer key
2013 PYQ

The procedure given below is required to find and replace certain characters inside an input character string supplied in array $$A.$$ The characters to be replaced are supplied in...

mediumanswer key
2005 PYQ

In a network of LANs connected by bridges, packets are sent from one LAN to another through intermediate bridges. Since more than one path may exist between two LANs, packets may h...

easyanswer key
2000 PYQ

The value of j at the end of the execution of the following C program int incr (int i) { static int count = 0; count = count + i; return (count); } main () { int i,j; for (i = 0; i...

easyanswer key
2000 PYQ

The most appropriate matching for the following pairs $$X:$$ Indirect addressing $$Y:$$ Immediate addressing $$Z:$$ Auto decrement addressing is $$1:$$ Loops $$2:$$ Pointers $$3.$$...

easyanswer key