C Functions Questions

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
What Shall be the output of the following code ?
#include <stdio.h>
int main()
{
int val = 10;
printf("%d %d %d", val++, val++, val++);
return 0;
}

10 11 12

10 11 12

12 11 10

12 11 10

12 12 12

12 12 12

6 7 8

6 7 8

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

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What is the output of the given code ?
#include <stdio.h>
int main()
{
printf("%d", main);
return 0;
}

Infinite loop.

Infinite loop.

Compilation error.

Compilation error.

0

0

Address of the main function

Address of the main function

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 will be the output of the program below ?
#include <stdio.h>
int main()
{
int (*p)(int ) = printer;
(*p)(3);
return 0;
}
int printer(int n)
{
for(;n > 0; n--)
printf("PrepSters ");
return 0;
}

PrepSters PrepSters PrepSters

PrepSters PrepSters PrepSters

PrepSters PrepSters

PrepSters PrepSters

Infinite loop.

Infinite loop.

Compiler error.

Compiler error.

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
How are variables passed in C  ?

By value result

By value result

By reference

By reference

By value

By value

Non-pointer variables are passed by value and pointers are passed by reference.

Non-pointer variables are passed by value and pointers are passed by reference.

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

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Select the correct option.

Functions can return any type.

Functions can return any type.

Functions can return any type except arrays and functions.

Functions can return any type except arrays and functions.

Functions can not return pointers types.

Functions can not return pointers types.

Functions can not return union types.

Functions can not return union types.

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What will be the output of the code given below ?
#include<stdio.h>
void loo(int var, ...)
{
printf("%d ", var);
}
int main()
{
loo(1,2,3,4,5);
loo(6,7,8);
return 0;
}

1 2 3 4 5 6 7 8

1 2 3 4 5 6 7 8

1 6

1 6

1 7

1 7

Compiler error.

Compiler error.

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

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
If we add static in the declaration of a function, what does it means for the function ?

The value returned by the function will be always constant.

The value returned by the function will be always constant.

It the case of function it doesn't make a difference.

It the case of function it doesn't make a difference.

Only the file where the function was declared can access that function.

Only the file where the function was declared can access that function.

There is no need to declare the function is it is static.

There is no need to declare the function is it is static.

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
A function be called with any parameter or code inside it's block ?

True

True

False

False

True but there should be some operation or command inside the function.

True but there should be some operation or command inside the function.

True but the function can not be void type.

True but the function can not be void type.

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
If a function is of extern type in it's declaration, what does it mean for the function ?

The value returned by the function will be global.

The value returned by the function will be global.

It doesn't make a difference.

It doesn't make a difference.

Only the file where the function was declared can access that function.

Only the file where the function was declared can access that function.

There is no need to declare the function is it is static.

There is no need to declare the function is it is static.

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 will be printed by the  following program ?
#include <stdio.h>
int main()
{
void printer();
void (*point)();
point = printer;
(*point)();
point();
return 0;
}

void printer()
{
printf("PrepYouTube ");
}

(null)

(null)

PrepYouTube PrepYouTube

PrepYouTube PrepYouTube

PrepYouTube

PrepYouTube

Compilation error.

Compilation error.

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+