Search Header Logo

Functions in C

Authored by Dr. Vinoth

Other

Professional Development

Used 77+ times

Functions in C
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will happen after compiling and running following code?

main( )

{

printf("%p", main);

}

Some address will be printed.

Will make an infinite loop.

Error

None of these.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

The keyword used to transfer control from a function back to the calling function is

goto

return

switch

exit

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

hat is the output of this C code?

int main()

{

void foo(), f();

}

void foo()

{printf("2 ");}

void f()

{

printf("1 ");

foo();}

Compile time error due to declaration of functions inside main

B.

C.

D.

1 2

as foo is local to main

2 1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose correct statement about Functions in C Language.

Every Function has a return type

.

Every Function may no may not return a value

A Function is a group of c statements which can be reused any number of times

All the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of C Program with functions.?

void myshow(int);

void main(){

int a=10;

printf("%d ", a);

myshow(a);

printf("%d", a);

}

void myshow(int k){

k=20;

}

10 20

10 10

20 20

Compiler error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following function calculates the square of 'x' in C?

.

sqr(x)

power(2, x)

pow(x, 2)

pow(2, x)

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

It is not advisable to use macros instead of functions because

.

recursion is not possible

no type checking will be done

it increases the code size

All of the above

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?