Mphasis Procedures Functions Scopes Quiz 1

Question 1

Time: 00:00:00
In functions , parameters are always

Passed by value

Passed by value

Passed by reference

Passed by reference

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

None of the above

None of the above

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 will be the output of the following program?

#include<stdio.h>
int main ()
{
printf ("Prepinsta");
main ();
return 0;
}

Prints Prepinsta 32767 time

Prints Prepinsta 32767 time

Till Stack Overflow

Till Stack Overflow

Compile time error

Compile time error

No output

No output

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 following program?

#include <stdio.h>
void m1()
{
int i;
printf ("s1 ");
for (i = 0; i < 5; i++)
{
printf ("s2 ");
if (i >= 1)
break;
printf ("s3 ");
}
printf ("s4 ");
}

void main ()
{
printf ("s0 ");
m1 ();
printf ("s5 ");
}

s0 s1 s2 s3 s2 s4 s5

s0 s1 s2 s3 s2 s4 s5

s0 s1 s2 s3 s4 s5

s0 s1 s2 s3 s4 s5

s0 s1 s2 s2 s2 s4 s5

s0 s1 s2 s2 s2 s4 s5

s0 s1 s2 s3 s2 s3 s4 s5

s0 s1 s2 s3 s2 s3 s4 s5

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What will be the output of the following program?

#include<stdio.h>
void main ()
{
printf ("%p ", main);
}

Error

Error

Infinite loop

Infinite loop

Some address will be printed

Some address will be printed

None of the above

None of the above

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

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
What is a function?

Function is a block of code that performs a specific task. It has a name and it is reusable.

Function is a block of code that performs a specific task. It has a name and it is reusable.

Function is the fundamental modular unit. A function is usually designed to perform a specific task.

Function is the fundamental modular unit. A function is usually designed to perform a specific task.

Function is a block of statements that perform some specific task.

Function is a block of statements that perform some specific task.

All of the above

All of the above

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 following program?

#include<stdio.h>
void main ()
{
m1 ();
void m1 ()
{
printf ("Prepinsta ");
}
}

Prepinsta

Prepinsta

Compile time error

Compile time error

No output

No output

Varies from compiler to compiler

Varies from compiler to compiler

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 of the following is the correct format for declaration of function?

 

return-type function-name(argument type);

return-type function-name(argument type);

return-type function-name(argument type){}

return-type function-name(argument type){}

return-type(argument type) function-name;

return-type(argument type) function-name;

All of the mentioned

All of the mentioned

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
The value obtained in the function is given back to main by using ------------ keyword.

 

return

return

static

static

new

new

volatile

volatile

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 is the return-type of the function sqrt()?

int

int

float

float

double

double

depends on the data type of the parameter function sqrt()

depends on the data type of the parameter function sqrt()

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 the use of a function ?

Helps to avoid repeating a set of statements many times.

Helps to avoid repeating a set of statements many times.

Enhances the logical clarity of the program.

Enhances the logical clarity of the program.

Helps to avoid repeated programming across programs.

Helps to avoid repeated programming across programs.

All of the above

All of the above

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

Please login to submit your explanation

Start

Question 11

Time: 00:00:00
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!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%

Prime Video

Prime Video

Complete Video Course for Mphasis

Prime Video

Prime Mock

Prime Mock

Topic-Wise Full Mock and much more

For Mphasis
Prime Mock

Comments