Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions tagged identify-function
0
votes
1
answer
31
Gate Sample Practise Questions
#include<stdio.h> int f(int *a, int n) { if(n ≤ 0) return 0; else if(*a % 2 = = 0) return *a + f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7, 13, 4, 11, 6}; printf("%d", f(a, 6)); return 0; } (a) -9 (b) 5 (c) 15 (d) 19 Need explanation stepwise for solution
Pranav Madhani
asked
in
Algorithms
May 26, 2017
by
Pranav Madhani
508
views
geeksforgeeks-test-series
recursion
identify-function
2
votes
1
answer
32
Based on GATE2005-IT-53
https://gateoverflow.in/3814/gate2005-it-53 i am confused about how the while loop breaks if a=''DBC" and b="BD"? i suppose here both occurence of B and D will have zero count in count arrray when for loop is checked. please explain?
nabadeep
asked
in
Algorithms
May 23, 2017
by
nabadeep
471
views
identify-function
2
votes
1
answer
33
Test by Bikram | Programming | Test 2 | Question: 9
Consider the below function: int s (int n) { if (n<=1) return 1 ; n = (n-1) * (n-1) -2 - n * n + 3*n ; s(n); printf(“%d”, n ); } What is the output if initial call is $s(6)$ ? $55555$ $11111$ $54321$ $12345$
Bikram
asked
in
Programming in C
May 14, 2017
by
Bikram
366
views
tbb-programming-2
identify-function
54
votes
7
answers
34
GATE CSE 2017 Set 2 | Question: 43
Consider the following snippet of a C program. Assume that swap $(\&x, \&y)$ exchanges the content of $x$ and $y$: int main () { int array[] = {3, 5, 1, 4, 6, 2}; int done =0; int i; while (done==0) { done =1; for (i=0; i<=4; i ... i-1]) { swap(&array[i], &array[i-1]); done =0; } } } printf( %d , array[3]); } The output of the program is _______
Arjun
asked
in
Programming in C
Feb 14, 2017
by
Arjun
16.9k
views
gatecse-2017-set2
programming
algorithms
numerical-answers
identify-function
30
votes
11
answers
35
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$
Madhav
asked
in
Programming in C
Feb 14, 2017
by
Madhav
9.6k
views
gatecse-2017-set2
programming-in-c
identify-function
pointers
2
votes
1
answer
36
Test by Bikram | Mock GATE | Test 3 | Question: 42
Read the below code snippet: int joo( int num ) { int result = 0 ; if ( num <= 1) return 1; else { for ( i=num; i >= 1; i - - ) { result + = joo( i / 3) ; } } return result; } When $num = 6$, the return value of the function is _____.
Bikram
asked
in
GATE
Feb 9, 2017
by
Bikram
317
views
tbb-mockgate-3
programming
programming-in-c
identify-function
numerical-answers
0
votes
1
answer
37
Test by Bikram | Mock GATE | Test 3 | Question: 26
The following function finds the $GCD$ recursively. int GCD(int k, int u) { if( u = = 0 ) return k ; else return GCD( u , ____); } Fill in the blank with the most appropriate function: $k/u$ $u/k$ $u \% k$ $k \% u$
Bikram
asked
in
GATE
Feb 9, 2017
by
Bikram
365
views
tbb-mockgate-3
programming
programming-in-c
identify-function
2
votes
3
answers
38
CMI2016-A-6
In the code fragment given below, $\mathsf{start}$ and $\mathsf{end}$ are integer values and $\mathsf{prime(x)}$ is a function that returns $\mathsf{true}$ if $\mathsf{x}$ is a prime number and $\mathsf{false}$ otherwise. i:=0; j:=0; k:=0; from (m := start; m <= end; m := m ... At the end of the loop: $k == i-j.$ $k == j-i.$ $k == -j-i.$ Depends on $\mathsf{start}$ and $\mathsf{end}$
go_editor
asked
in
Programming in C
Dec 30, 2016
by
go_editor
612
views
cmi2016
identify-function
6
votes
1
answer
39
TIFR CSE 2016 | Part B | Question: 12
A computer program computes a function $\: f \: \{0, 1\}^* \times \{0, 1\}^* \rightarrow \{0, 1\}^*$. Suppose $f(a, b)$ ahs length $\mid b \mid ^2$, where $\mid a \mid$ and $\mid b \mid$ are the lengths of $a$ and $b$. Suppose, using this program, the following ... $n^2 < t \leq n^{\log_2 n}$ $ n^{\log_2 n} < t \leq 2^{(2n)}$ $2^{(2n)} < t$
go_editor
asked
in
Algorithms
Dec 29, 2016
by
go_editor
713
views
tifr2016
algorithms
identify-function
8
votes
1
answer
40
TIFR CSE 2017 | Part A | Question: 12
Consider the following program modifying an $n \times n$ square matrix $A$: for i=1 to n: for j=1 to n: temp=A[i][j]+10 A[i][j]=A[j][i] A[j][i]=temp-10 end for end for Which of the following statements about the contents of matrix $A$ at the end of ... the new matrix $A$ is symmetric, that is, $A[i][j]=A[j][i]$ for all $1 \leq i, j \leq n$ $A$ remains unchanged
go_editor
asked
in
Algorithms
Dec 22, 2016
by
go_editor
1.4k
views
tifr2017
algorithms
identify-function
5
votes
2
answers
41
GATE CSE 1989 | Question: 8a
What is the output produced by the following program, when the input is "HTGATE" Function what (s:string): string; var n:integer; begin n = s.length if n <= 1 then what := s else what :=contact (what (substring (s, 2, n)), s.C [1]) end; Note ... $s_{2}$ - length obtained by concatenating $s_{1}$ with $s_{2}$ such that $s_{1}$ precedes $s_{2}$.
makhdoom ghaya
asked
in
Algorithms
Dec 3, 2016
by
makhdoom ghaya
1.3k
views
gate1989
descriptive
algorithms
identify-function
13
votes
3
answers
42
GATE CSE 1990 | Question: 11b
The following program computes values of a mathematical function $f(x)$. Determine the form of $f(x)$. main () { int m, n; float x, y, t; scanf ("%f%d", &x, &n); t = 1; y = 0; m = 1; do { t *= (-x/m); y += t; } while (m++ < n); printf ("The value of y is %f", y); }
makhdoom ghaya
asked
in
Algorithms
Nov 25, 2016
by
makhdoom ghaya
2.1k
views
gate1990
descriptive
algorithms
identify-function
11
votes
2
answers
43
GATE Overflow | Programming | Test 1 | Question: 13
What is the following function doing? unsigned int foo(unsigned int x) { unsigned int c = sizeof x; c <<= 3; if(x == 0) return c; c--; while(x = x & x-1) c--; return c; } Counting the number ... the number of set bits in the binary representation of x Counting the number of unset bits in the binary representation of x None of the above
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.8k
views
go-programming-1
programming
identify-function
5
votes
3
answers
44
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
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
2.5k
views
go-programming-1
programming
programming-in-c
identify-function
2
votes
1
answer
45
Explain how it comes ??? # Algo.
Consider the following code: int P=0; for (i=1; i<2n; i++) { for (j=1; j<=n; j++) { if (j<i) P =P+1; } } printf(“%d”, P); What is the output printed by the above code in terms of n
Çșȇ ʛấẗẻ
asked
in
Algorithms
Aug 28, 2016
by
Çșȇ ʛấẗẻ
386
views
algorithms
identify-function
output
5
votes
5
answers
46
ISRO2011-40
Consider the following pseudocode x:=1; i:=1; while ( x <= 500) begin x:=2^x; i:=i+1; end What is the value of $\textsf{i}$ at the end of the pseudocode? $4$ $5$ $6$ $7$
go_editor
asked
in
Algorithms
Jun 22, 2016
by
go_editor
5.0k
views
isro2011
algorithms
identify-function
6
votes
1
answer
47
ISRO2008-69
What is the value of $F(4)$ using the following procedure: function F(K : integer) integer; begin if (k<3) then F:=k else F:=F(k-1)*F(k-2)+F(k-3) end; $5$ $6$ $7$ $8$
go_editor
asked
in
Algorithms
Jun 13, 2016
by
go_editor
3.2k
views
isro2008
algorithms
recursion
identify-function
5
votes
3
answers
48
ISRO2007-23
Study the following program //precondition: x>=0 public void demo(int x) { System.out.print(x % 10); if (x % 10 != 0) { demo(x/10); } System.out.print(x%10); } Which of the following is printed as a result of the call demo $(1234)$? $1441$ $3443$ $12344321$ $43211234$
go_editor
asked
in
Algorithms
Jun 10, 2016
by
go_editor
3.6k
views
isro2007
algorithms
identify-function
0
votes
1
answer
49
IISC-CSA-Research-Test-4
What is the output of the following program? int main() { int i=0; do { if (i >=5) { i+=2; printf("%d \n", i); break; } else { printf("%d \n", ++i); continue; } } while (i<7); }
go_editor
asked
in
Algorithms
Jun 7, 2016
by
go_editor
426
views
iisccsaresearch2016
descriptive
algorithms
identify-function
iisc-interview
1
vote
1
answer
50
ISI2014-PCB-A-1b
Let $x, y$ be two non-negative integers $< 2^{32}$. By $x \wedge y$ we mean the integer represented by the bitwise logical $AND$ of the 32- bit binary representations of $x$ and $y$. For example, if $x = 13$ and $y = 6$, then $x \wedge y$ ... the pseudo-code for the input $x = 13$? What will be the output of the pseudo-code for an arbitrary non-negative integer $x < 2^{32}$?
go_editor
asked
in
Algorithms
May 30, 2016
by
go_editor
484
views
descriptive
isi2014
algorithms
identify-function
1
vote
1
answer
51
CMI2011-B-07b
A finite sequence of bits is represented as a list with values from the set $\{0,1\}$-for example, $[0,1,0], [1,0,1,1], \dots [ \: ]$ denotes the empty list, and $[b]$ is the list consisting of one bit $b$. For a nonempty list $l, \text{ head}(l)$ returns the first ... g2(n) if (n == 0) then return(0) else return f2(g2(n-1),g1(n)) endif What is the value of $g2(256)$ and $g2(257)$?
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
500
views
descriptive
cmi2011
algorithms
identify-function
7
votes
1
answer
52
CMI2010-B-07b
A finite sequence of bits is represented as a list with values from the set $\{0,1\}$. For example, $[0,1,0], [1,0,1,1], \dots [ \: ]$ denotes the empty list, and $[b]$ is the list consisting of one bit $b$. The function $\text{length}(l)$ ... mystery1(mystery2(s,tail(t)),mystery2(s,tail(t)))) endif Suppose $s=t=110100100$. What are the first two bits of $\text{mystery2(s,t)}$?
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
1.1k
views
descriptive
cmi2010
algorithms
identify-function
5
votes
2
answers
53
CMI2015-B-06b
Consider the code below, defining the functions $f$ and $g$: f(m, n) { if (m == 0) return n; else { q = m div 10; r = m mod 10; return f(q, 10*n + r); } } g(m, n) { if (n == 0) return m; else { q = m div 10; r = m mod 10; return g(f(f(q, 0), r), n-1); } } What does $g(m, n)$ compute, for nonnegative numbers $m$ and $n$?
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
556
views
descriptive
cmi2015
algorithms
identify-function
2
votes
2
answers
54
CMI2015-B-06a
Consider the code below, defining the functions $f$ and $g$: f(m, n) { if (m == 0) return n; else { q = m div 10; r = m mod 10; return f(q, 10*n + r); } } g(m, n) { if (n == 0) return m; else { q = m div 10; r = m mod 10; return g(f(f(q, 0), r), n-1); } } Compute $g(3, 7), \: g(345, 1), \: g(345, 4) \text{ and } \: g(345, 0)$.
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
504
views
descriptive
cmi2015
algorithms
identify-function
3
votes
2
answers
55
CMI2014-B-07c
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n-1,p), p-1); } Compute $A(2, 2, 3)$ and $A(2, 3, 3)$.
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
620
views
cmi2014
descriptive
algorithms
identify-function
3
votes
2
answers
56
CMI2014-B-07b
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n-1,p), p-1); } Express $A(m, n, 2)$ as a function of $m$ and $n$.
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
649
views
cmi2014
descriptive
algorithms
identify-function
3
votes
2
answers
57
CMI2014-B-07a
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n-1,p), p-1); } Express $A(m, n, 1)$ as a function of $m$ and $n$.
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
655
views
cmi2014
descriptive
algorithms
identify-function
3
votes
3
answers
58
CMI2014-A-03
In the code fragment on the right, start and end are integer values and $\text{prime}(x)$ is a function that returns true if $x$ is a prime number and $\text{false}$ otherwise. At the end of the loop: i := 0; j := 0; k := 0; for (m := start; m <= end; m := m+1){ k := k + m ... + m; }else{ j := j + m; } } $k < i+j$ $k = i+j$ $k > i+j$ Depends on $\text{start}$ and $\text{end}$
go_editor
asked
in
Algorithms
May 27, 2016
by
go_editor
891
views
cmi2014
algorithms
identify-function
9
votes
3
answers
59
CMI2013-A-09
The below question is based on the following program. procedure mystery (A : array [1..100] of int) int i,j,position,tmp; begin for j := 1 to 100 do position := j; for i := j to 100 do if (A[i] > A[position]) then ... A[position] := tmp; endfor end When the procedure terminates, the array A has been: Reversed Left unaltered Sorted in descending order Sorted in ascending order
go_editor
asked
in
Algorithms
May 23, 2016
by
go_editor
1.1k
views
cmi2013
algorithms
identify-function
2
votes
1
answer
60
CMI2012-A-04
The below question is based on the following program. In the program, we assume that integer division returns only the quotient. For example $7/3$ returns $2$ since $2$ is the quotient and $1$ is the remainder. mystery(a,b){ if (b == 0) return a; if (a < b) return mystery(b,a); if (eo(a ... $a,\: b$ is $O(n)$ $O(\log \log n)$ $O(\log n)$ $O(n^{\frac{1}{2}})$
go_editor
asked
in
Algorithms
May 22, 2016
by
go_editor
590
views
cmi2012
algorithms
identify-function
time-complexity
Page:
« prev
1
2
3
4
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions tagged identify-function
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...