Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Hot questions in Programming in C
31
votes
11
answers
101
GATE CSE 2017 Set 2 | Question: 14
Consider the following function implemented in C: void printxy(int x, int y) { int *ptr; x=0; ptr=&x; y=*ptr; *ptr=1; printf(“%d, %d”, x, y); } The output of invoking $printxy(1,1)$ is: $0, 0$ $0, 1$ $1, 0$ $1, 1$
Consider the following function implemented in C:void printxy(int x, int y) { int *ptr; x=0; ptr=&x; y=*ptr; *ptr=1; printf(“%d, %d”, x, y); }The output of invoking $...
Madhav
9.8k
views
Madhav
asked
Feb 14, 2017
Programming in C
gatecse-2017-set2
programming-in-c
identify-function
pointers
+
–
2
votes
4
answers
102
ISRO2014-47
The following three 'C' language statements is equivalent to which single statement? y=y+1; z=x+y; x=x+1 z = x + y + 2; z = (x++) + (++y); z = (x++) + (y++); z = (x++) + (++y) + 1;
The following three 'C' language statements is equivalent to which single statement?y=y+1; z=x+y; x=x+1z = x + y + 2;z = (x++) + (++y);z = (x++) + (y++);z = (x++) + (++y)...
jenny101
5.0k
views
jenny101
asked
Jun 25, 2016
Programming in C
isro2014
programming-in-c
+
–
73
votes
2
answers
103
GATE CSE 2013 | Question: 42
What is the return value of $f(p,p)$, if the value of $p$ is initialized to $5$ before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value. int f (int &x, int c) { c = c - 1; if (c==0) return 1; x = x + 1; return f(x,c) * x; }
What is the return value of $f(p,p)$, if the value of $p$ is initialized to $5$ before the call? Note that the first parameter is passed by reference, whereas the second ...
gatecse
21.4k
views
gatecse
asked
Aug 7, 2014
Programming in C
gatecse-2013
compiler-design
normal
marks-to-all
numerical-answers
parameter-passing
runtime-environment
+
–
0
votes
1
answer
104
UGC NET CSE | June 2010 | Part 2 | Question: 33
Consider the following left associative operators in decreasing order of precedence : - subtraction (highest precedence) * multiplication $ exponentiation (lowest precedence) What is the result of the following expression ? 3 – 2 * 4 $ | * 2** 3 $-61$ $64$ $512$ $4096$
Consider the following left associative operators in decreasing order of precedence :- subtraction (highest precedence)* multiplication$ exponentiation (lowest precedence...
makhdoom ghaya
1.5k
views
makhdoom ghaya
asked
Sep 16, 2016
Programming in C
ugcnetcse-june2010-paper2
programming
operator-precedence
+
–
44
votes
4
answers
105
GATE CSE 2008 | Question: 60
What is printed by the following C program? int f(int x, int *py, int **ppz) { int y, z; **ppz += 1; z = **ppz; // corrected z = *ppz; to z = **ppz; *py += 2; y = *py; x += 3; return x+y+z; } void main() { int c, *b, **a; c = 4; b = &c; a = &b; printf("%d", f(c, b, a)); } $18$ $19$ $21$ $22$
What is printed by the following C program?int f(int x, int *py, int ppz) { int y, z; ppz += 1; z = ppz; // corrected z = *ppz; to z = ppz; *py += 2; y = *py; x += 3;...
Kathleen
18.2k
views
Kathleen
asked
Sep 12, 2014
Programming in C
gatecse-2008
programming
programming-in-c
normal
parameter-passing
+
–
3
votes
4
answers
106
C PROGRAMMING
kamboj
3.3k
views
kamboj
asked
Mar 20, 2017
37
votes
4
answers
107
GATE IT 2005 | Question: 58
Let $a$ be an array containing $n$ integers in increasing order. The following algorithm determines whether there are two distinct numbers in the array whose difference is a specified number $S > 0$. i = 0; j = 1; while (j < n ){ if (E) j++; else if (a[j] - a[i] == S) break; else i+ ... $a[j] - a[i] < S$ $a[i] - a[j] < S$ $a[i] - a[j] > S$
Let $a$ be an array containing $n$ integers in increasing order. The following algorithm determines whether there are two distinct numbers in the array whose difference i...
Ishrat Jahan
9.9k
views
Ishrat Jahan
asked
Nov 3, 2014
Programming in C
gateit-2005
programming
normal
programming-in-c
+
–
32
votes
5
answers
108
GATE IT 2007 | Question: 31
Consider the C program given below : #include <stdio.h> int main () { int sum = 0, maxsum = 0, i, n = 6; int a [] = {2, -2, -1, 3, 4, 2}; for (i = 0; i < n; i++) { if (i == 0 || a [i] < 0 || a [i] < a [ ... } if (sum > maxsum) maxsum = sum ; printf ("%d\n", maxsum); } What is the value printed out when this program is executed? $9$ $8$ $7$ $6$
Consider the C program given below : #include <stdio.h int main () { int sum = 0, maxsum = 0, i, n = 6; int a [] = {2, -2, -1, 3, 4, 2}; for (i = 0; i < n; i++) { if (i =...
Ishrat Jahan
11.0k
views
Ishrat Jahan
asked
Oct 29, 2014
Programming in C
gateit-2007
programming
programming-in-c
normal
+
–
0
votes
1
answer
109
GATE CSE 1988 | Question: 8iii
Write a LISP function to compute the product of all the numbers in a list. Assume that the list contains only number.
Write a LISP function to compute the product of all the numbers in a list. Assume that the list contains only number.
go_editor
503
views
go_editor
asked
Dec 19, 2016
Programming in C
gate1988
descriptive
programming
lisp
out-of-gate-syllabus
+
–
0
votes
1
answer
110
Gate 2017 Set 1 minimum Comparisons
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required in worst case by optimal algorithm?
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required ...
yg92
234
views
yg92
asked
Feb 12, 2017
Programming in C
numerical-answers
algorithms
+
–
37
votes
3
answers
111
GATE CSE 2010 | Question: 11
What does the following program print? #include<stdio.h> void f(int *p, int *q) { p=q; *p=2; } int i=0, j=1; int main() { f(&i, &j); printf("%d %d\n", i,j); return 0; } $2 \ 2$ $2 \ 1$ $0 \ 1$ $0 \ 2$
What does the following program print?#include<stdio.h void f(int *p, int *q) { p=q; *p=2; } int i=0, j=1; int main() { f(&i, &j); printf("%d %d\n", i,j); return 0; }$2 \...
go_editor
9.8k
views
go_editor
asked
Sep 29, 2014
Programming in C
gatecse-2010
programming
programming-in-c
easy
parameter-passing
+
–
58
votes
3
answers
112
GATE CSE 2016 Set 1 | Question: 15
Consider the following C program. # include <stdio.h> void mystery (int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb =ptra; ptra = temp; } int main () { int a = 2016, b=0, c= 4, d = 42; mystery (&a, &b); if (a < c) mystery (&c, &a); mystery (&a, &d); printf("%d\n", a); } The output of the program is _________.
Consider the following C program.# include <stdio.h void mystery (int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb =ptra; ptra = temp; } int main () { int a...
Sandeep Singh
18.3k
views
Sandeep Singh
asked
Feb 12, 2016
Programming in C
gatecse-2016-set1
programming-in-c
easy
numerical-answers
parameter-passing
+
–
42
votes
2
answers
113
GATE IT 2008 | Question: 52
C program is given below: # include <stdio.h> int main () { int i, j; char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}}; char b [3] [2]; char *p = *b; for (i = 0; i < 2; i++) { for (j = 0; j < ... $\text{b e}$ $\text{c f}$ $\text{a c}$ $\text{e b}$ $\text{d f}$ $\text{a e}$ $\text{d c}$ $\text{b f}$
C program is given below:# include <stdio.h int main () { int i, j; char a [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}}; char b [3] ; char *p = *b; for (i = 0; i < 2; i++)...
Ishrat Jahan
10.6k
views
Ishrat Jahan
asked
Oct 28, 2014
Programming in C
gateit-2008
programming
programming-in-c
normal
array
+
–
30
votes
3
answers
114
GATE IT 2004 | Question: 58
Consider the following C program which is supposed to compute the transpose of a given $4 \times 4$ matrix $M$. Note that, there is an $X$ in the program which indicates some missing statements. Choose the correct option to replace $X$ in the program. #include<stdio.h> #define ROW 4 #define COL 4 ... j < 4; ++j){ M[i][j] = t; t = M[j][i]; M[j][i] = M[i][j]; }
Consider the following C program which is supposed to compute the transpose of a given $4 \times 4$ matrix $M$. Note that, there is an $X$ in the program which indicates ...
Ishrat Jahan
12.5k
views
Ishrat Jahan
asked
Nov 2, 2014
Programming in C
gateit-2004
programming
easy
programming-in-c
array
+
–
50
votes
7
answers
115
GATE CSE 2016 Set 2 | Question: 35
The following function computes $X^{Y}$ for positive integers $X$ and $Y$. int exp (int X, int Y) { int res =1, a = X, b = Y; while (b != 0) { if (b % 2 == 0) {a = a * a; b = b/2; } else {res = res * a; b = b - 1; } } return res; } Which one of the following ... $X^{Y} = a^{b}$ $(res * a)^{Y} = (res * X)^{b}$ $X^{Y} = res * a^{b}$ $X^{Y} = (res * a)^{b}$
The following function computes $X^{Y}$ for positive integers $X$ and $Y$.int exp (int X, int Y) { int res =1, a = X, b = Y; while (b != 0) { if (b % 2 == 0) {a =...
Akash Kanase
14.2k
views
Akash Kanase
asked
Feb 12, 2016
Programming in C
gatecse-2016-set2
programming
loop-invariants
normal
+
–
13
votes
4
answers
116
GATE CSE 2019 | Question: 18
Consider the following C program : #include<stdio.h> int jumble(int x, int y){ x = 2*x+y; return x; } int main(){ int x=2, y=5; y=jumble(y,x); x=jumble(y,x); printf("%d \n",x); return 0; } The value printed by the program is ______________.
Consider the following C program :#include<stdio.h int jumble(int x, int y){ x = 2*x+y; return x; } int main(){ int x=2, y=5; y=jumble(y,x); x=jumble(y,x); printf("%d \n"...
Arjun
9.9k
views
Arjun
asked
Feb 7, 2019
Programming in C
gatecse-2019
programming-in-c
numerical-answers
identify-function
1-mark
+
–
1
votes
1
answer
117
Merge Sort Merge Procedure
Guys i was trying to implement merge procedure of merge sort i found some interesting results.I don't know why it happened but if you know please comment and clear my doubt This is my code #include <iostream> using namespace std; void ... garbage value don't know on second execution.When third time i executed i get correct Please help why its happening :)
Guys i was trying to implement merge procedure of merge sort i found some interesting results.I don't know why it happened but if you know please comment and clear my dou...
Himanshu Goyal
428
views
Himanshu Goyal
asked
Aug 31, 2016
Programming in C
merge-sort
algorithms
+
–
31
votes
5
answers
118
GATE CSE 1999 | Question: 2.5
Given the programming constructs assignment for loops where the loop parameter cannot be changed within the loop if-then-else forward go to arbitrary go to non-recursive procedure call recursive procedure/function call repeat loop, which constructs will you not include in a programming language ... $\text{(vi), (vii), (viii)}$ $\text{(iii), (vii), (viii)}$
Given the programming constructsassignmentfor loops where the loop parameter cannot be changed within the loopif-then-elseforward go toarbitrary go tonon-recursive proced...
Kathleen
12.8k
views
Kathleen
asked
Sep 23, 2014
Programming in C
gate1999
programming
normal
programming-constructs
+
–
5
votes
3
answers
119
GATE Overflow | Programming | Test 1 | Question: 4
Consider the following C functions: int f1(int a, int b) { while (a != b) { if(a > b) a = a - b; else b = b - a; } return a; } int f2(int a, int b) { while (b != 0) { int t = b; ... for all positive inputs but not f3 For some positive input all 3 functions return different values f2 and f3 return same value for all positive inputs but not f1
Consider the following C functions:int f1(int a, int b) { while (a != b) { if(a b) a = a - b; else b = b - a; } return a; } int f2(int a, int b) { while (b != 0) { int t...
Arjun
2.6k
views
Arjun
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
identify-function
+
–
5
votes
2
answers
120
Find output of the following C program
#include <stdio.h> int main() { int y = 2; int z = y +(y = 10); printf("%d\n", z); }
#include <stdio.h int main() { int y = 2; int z = y +(y = 10); printf("%d\n", z); }
Mandeep Singh
18.4k
views
Mandeep Singh
asked
Oct 22, 2016
Programming in C
programming-in-c
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
...
206
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register