GATE 2024 Programming & Data Structures Rank Booster Quiz 26
Attempt now to get your rank among 46 students!
Question 1
int foo (unsigned int n)
{
int c, x = 0;
while (n! = 0)
{
if (n & 01) x ++;
n >> = 1;
}
return x;
}
The value returned by the foo (10) is _________.
Question 2Multiple Correct Options
Question 3
Question 4
int f (int a)
{
return (a * 2);
}
int g (int a)
{
return (a * 3);
}
int h (int a, int b)
{
return (a + b);
}
void main( )
{
int x =2, y = 3;
x =h (f (2), g (3));
printf ("%d", x + y);
}
What will be the output of above code?
Question 5
int find (int a)
{
if (a = = 0) return 1;
else return (find (a - 1) +1):
}
What will be the return value of find (5)?
Question 6
The output of the above program is ______.
________________
Question 7
int main ( )
{
int * a;
a= function1 ( ) ;
printf(“%d”, *a);
}
int * function1 ( )
{
int m= 1;
int * x;
x = &m;
return x;
}
Which of the following statement is true?
I. It results 9
II. Runtime error
III. Compilation error
Assume all the header files and function definition correctly done.
- 46 attempts
- 0 upvotes
- 0 comments