loops
GATE CSE & IT · Data Structures · 2000-2025
Study anchor
Source-book anchor pending for this concept.
Practice action
Start latest PYQPYQs in this concept
All concepts →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;...
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 (...
Consider the following C program: #include <stdio.h> int main() { int a = 6; int b = 0; while(a Which one of the following statements is CORRECT?
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...
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,...
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 *...
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...
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...
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...
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...
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...
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...
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...
The most appropriate matching for the following pairs $$X:$$ Indirect addressing $$Y:$$ Immediate addressing $$Z:$$ Auto decrement addressing is $$1:$$ Loops $$2:$$ Pointers $$3.$$...