C Functions Questions 3

Hello PrepSter,

If you find any errors in the quiz below kindly comment in the comment section and we will make it our priority to fix it.

Also if you have a better of the solution to the questions, please do comment them below and if we find it better than ours, we will post it in our website.

Question 1

Time: 00:00:00
Which of the following option if added in the blank will not result in a compiler error ?
#include <stdio.h>
void fun(int a, int b);
void main()
{
int i = 100;
int num = 12;
int *p = &num;
__________;
}

i=fun(i,*num)

i=fun(i,*num)

fun(num,*p)

fun(num,*p)

fun(num,*num)

fun(num,*num)

fun(i,num)

fun(i,num)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
For a given boolean function boo(x1,x2,x3,....,xn), which of the following will return a false value ?

boo(x1,x2,x3,....,xn) ==( (x1)&& boo(x1,x2,x3,....,xn) ) || ( (x1')&&boo(x1,x2,x3,....,xn) )

boo(x1,x2,x3,....,xn) ==( (x1)&& boo(x1,x2,x3,....,xn) ) || ( (x1')&&boo(x1,x2,x3,....,xn) )

boo(x1,x2,x3,....,xn) ==( (x2')&&boo(x1,x2,x3,....,xn) ) || ( (x2)&&boo(x1,x2,x3,....,xn) )

boo(x1,x2,x3,....,xn) ==( (x2')&&boo(x1,x2,x3,....,xn) ) || ( (x2)&&boo(x1,x2,x3,....,xn) )

boo(x1,x2,x3,....,xn) ==( (xn)&& boo(1,x2,x3,....,0) ) || ( (xn')&&boo(x1,x2,x3,....,1) )

boo(x1,x2,x3,....,xn) ==( (xn)&& boo(1,x2,x3,....,0) ) || ( (xn')&&boo(x1,x2,x3,....,1) )

boo(x1,x2,x3,....,xn) == boo(x1,x2,x3,....,0) || (boo(x1,x2,x3,....,1)

boo(x1,x2,x3,....,xn) == boo(x1,x2,x3,....,0) || (boo(x1,x2,x3,....,1)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What is the expected output of the recursive code given below C code given below ?
#include <stdio.h>
int count(int x, int y)
{
static int i;
if (y !=1 )
{
if (x !=1)
{
i++;
count(x/2, y);
}
else
{
y=y-1;
count(1024, y);
}
}
return i;
}
int main()
{
printf("Final value of i is %d",count(512,1024));
}

Final value of i is 10230

Final value of i is 10230

Final value of i is 10229

Final value of i is 10229

Final value of i is 9207.

Final value of i is 9207.

Final value of i is 9216.

Final value of i is 9216.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Select the correct output of the code given below.
#include <stdio.h>
int loo(int i)
{
if(i!=100)
{
i=i-10;
}
else if(i<100)
{
i=1+11;
loo(i);
}
return i;
}
int main()
{
printf("%d",loo(95));
}

85

85

95

95

91

91

99

99

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Observe the code below.
void swap(int a, int b)
{
int temp;
temp=a;
a=b;
b=temp;
}



To swap the values of two integer values x and y, what should be the call in main ?

swap(x,y)

swap(x,y)

swap(*x,*y)

swap(*x,*y)

The function can not be used to swap because swap doesn't have a return type.

The function can not be used to swap because swap doesn't have a return type.

The function can not be used to swap because parameters are called by value.

The function can not be used to swap because parameters are called by value.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Select the option that is true relating to function overloading.

The compiler doesn't make a new function for every definition of function.

The compiler doesn't make a new function for every definition of function.

The compiler makes a new function fir every definition of function.

The compiler makes a new function fir every definition of function.

Overloading function can't handle different types of objects

Overloading function can't handle different types of objects

Overloaded functions can't have same number of arguments

Overloaded functions can't have same number of arguments

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
Which is following is not a side effect of a scan conversion ?

a. Aliasing

b. Unequal intensity of diagonal lines

c. Overstriking in photographic applications

d. Local or Global aliasing

a and b

a and b

a and c

a and c

only a

only a

none of them

none of them

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What is the expected output of the following program ?
#include<stdio.h>
void main()
{
double pi = 3.1415926535;
int a = 1;
int i;
for(i=0; i < 4; i++)
{
if(a = sin(pi * i/2) )
{
printf("%d ",1);
}
else
{
printf("%d ", 0);
}
}
}

1 0 0 1

1 0 0 1

1 0 1 0

1 0 1 0

0 1 0 1

0 1 0 1

0 0 1 0

0 0 1 0

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What will be printed b this Code below ?
#include<stdio.h>
int tmkc(int printer)
{
static int i = 1;
if(printer >= 10) return printer;
printer = printer+i;
i++;
return tmkc(printer);
}
int main()
{
printf("%d",tmkc(1));
}

11

11

7

7

16

16

5

5

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What is printed by the following program ?
#include<stdio.h>
int main ()
{

int x = 11, y = 14;
if(x < y)
{
printf("lol.");
return (x = x + y);
}
else
printf ("This might get printed.");
printf("This should get printed");
}

This might get printed.This should get printed

This might get printed.This should get printed

This should get printed.This should get printed

This should get printed.This should get printed

lol.This should get printed

lol.This should get printed

lol

lol

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Hey ! Follow us on G+