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

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

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

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

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

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

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

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

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

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

["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%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments