0% found this document useful (0 votes)
4 views

Assignment 22 Typesoffunctions Ans

The document contains 20 multiple choice questions about functions in C language. It covers topics like function declaration, return types, arguments, built-in functions like printf, getch etc. and categorizing them based on if they take arguments and return values or not.

Uploaded by

Yash rai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment 22 Typesoffunctions Ans

The document contains 20 multiple choice questions about functions in C language. It covers topics like function declaration, return types, arguments, built-in functions like printf, getch etc. and categorizing them based on if they take arguments and return values or not.

Uploaded by

Yash rai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Assignment of objective questions

1. Arguments are those entities which are...

a. Passed to the function during a call in its parenthesis.


b. Returned by the function after executing its body.
c. Those variables using which declared inside the body of the function.
d. Those variables which operates on the value returned by the function.

Answer - a. Passed to the function during a call in its parenthesis.

2. In the C language, functions can return more than one value?

a. Yes
b. No
c. Only in Modern Compilers.
d. Only in Turbo compiler.

Answer - b. No

3. Function declaration is also known as...

a. Function Prototype
b. Function Body
c. Function Definition
d. None of the above

Answer - a. Function Prototype


4. Which of the following is the correct syntax of the function declaration.

a. <return_type> <function_name> (<list_of_arguments>)


b. <return_type> <function_name> (<list_of_arguments>);
c. <return_type> = <function_name> (<list_of_arguments>)
d. <return_type> = <function_name> (<list_of_arguments>);

Answer - b. <return_type> <function_name> (<list_of_arguments>);

5. How many types of functions are available in the C language?

a. 2
b. 4
c. 6
d. 8

Answer - b. 4

6. pow() of math. h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - a. Takes something and returns something

7. fflush() of stdio.h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - b. Takes something and returns nothing


8. delay() function is available in the header file...

a. time.h
b. stdio.h
c. conio.h
d. dos. h

Answer - d. dos. h

9. The argument passed to the delay function is in...

a. milliseconds
b. nanoseconds
c. microseconds
d. None of the above

Answer - a. milliseconds

10. The arguments passed to the gotoxy() function is...

a. <column>, <row>
b. <row>, <column>
c. Compiler dependent behavior
d. None of the above

Answer - a. <column>, <row>

11. getch() of conio.h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - c. Takes nothing and returns something


12. clrscr() of conio.h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - d. Takes nothing and returns nothing

13. The return type of function getch() of conio.h in C language is...

a. int
b. char
c. float
d. double

Answer - a. int

14. Is it compulsory to receive value if the function returns some value?

a. Yes, Syntax Error


b. Yes, Compilation Error
c. Yes, Runtime Error
d. No, Code will execute with 0 Error and 0 Warning

Answer - d. No, Code will execute with 0 Error and 0 Warning

15. The return type of function printf() of stdio.h in C language is...

a. int
b. char
c. float
d. void

Answer - a. int
16. The return type of function printf() of stdio.h in C language is...

a. int
b. char
c. float
d. void

Answer - a. int

17. What is the behavior of a code in which we try to receive a value from a
function whose return type is void?

a. Syntax Error
b. Compilation Error
c. Runtime Error
d. No, Code will execute with 0 Error and 0 Warning

Answer - b. Compilation Error

18. To display colored text on console in Turbo Compiler the function is used is...

a. printf();
b. print();
c. cprintf();
d. None of the above

Answer - a. printf();

19. gotoxy() of conio.h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - b. Takes something and returns nothing


20. textcolor() of conio.h belongs to which category of function?

a. Takes something and returns something


b. Takes something and returns nothing
c. Takes nothing and returns something
d. Takes nothing and returns nothing

Answer - b. Takes something and returns nothing

You might also like