Question 1 |
Consider the following program:
Which one of the following options represents the activation tree corresponding to the main function?

int main()
{
f1();
f2(2);
f3();
return(0);
}
int f1()
{
return(1);
}
int f2(int X)
{
f3();
if (X==1)
return f1();
else
return (X*f2(X-1));
}
int f3()
{
return(5);
}
Which one of the following options represents the activation tree corresponding to the main function?

A | |
B | |
C | |
D |
Question 1 Explanation:
Question 2 |
The integer value printed by the ANSI-C program given below is ______.
#include < stdio.h >
int funcp(){
static int x = 1;
x++;
return x;
}
int main(){
int x,y;
x = funcp();
y = funcp()+x;
printf("%d\n", (x+y));
return 0;
}
2 | |
5 | |
7 | |
9 |
Question 2 Explanation:
Question 3 |
Consider the following ANSI C program
#include < stdio.h >
int foo(int x, int y, int q)
{
if ((x < = 0) && (y < = 0))
return q;
if (x < = 0)
return foo(x, y-q, q);
if (y < = 0)
return foo(x-q, y, q);
return foo(x, y-q, q) + foo(x-q, y, q);
}
int main( )
{
int r = foo(15, 15, 10);
printf("%d", r);
return 0;
}
The output of the program upon execution is ____10 | |
60 | |
180 | |
220 |
Question 3 Explanation:
Question 4 |
Consider the following ANSI C function:
int SomeFunction (int x, int y)
{
if ((x==1) || (y==1)) return 1;
if (x==y) return x;
if (x > y) return SomeFunction(x-y, y);
if (y > x) return SomeFunction (x, y-x);
}
The value returned by SomeFunction(15, 255) is __________17 | |
15 | |
255 | |
5 |
Question 4 Explanation:
Question 5 |
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*total +Y[loopIndex];
return total;
}
Let Z be an array of 10 elements with Z[i]=1, for all i such that 0\leq i \leq 9. The value returned by SimpleFunction(Z,10,2) is __________1023 | |
511 | |
255 | |
2047 |
Question 5 Explanation:
There are 5 questions to complete.
Question 65 wrong
Thank You Abhishek Chavle,
We have updated the question.
Question number 86 of functions in c programming it should be c<b instead of c=b . Please do change.
Thank You PRAFUL SAMBHAJI RANE,
We have updated the question.
Question number 12 of functions of c programming there is typing mistake in question itself . Instead f () you have written if. Please do change it 🙏
Thank You PRAFUL SAMBHAJI RANE,
We have updated the question.
Question number 86 of functions in c programming
Correct question
int Trial (int a, int b, int c)
{
if ((a >= b) && (c =b) return Trial(a, c, b);
else return Trial(b, a, c);
}
Thank You PRAFUL SAMBHAJI RANE,
We have updated the question.
question 58.
2 options are same
Thank You Bikash Dutta,
We have updated the options.
In Ques no-62 there is one small misprint , there will be z=**ppz
in Q 60.
z= **ppz
Pls separate out ISRO and GATE questions!
Page 11 is redirecting to a wrong location. Unable to solve questions from page 11.
Dear Dhruv,
We have tested page 11 and working perfect for our testing device.