wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Untitled Quiz

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

List the categories of user defined function.

a)

1. Function with no arguments and no return type.

b)

2. Function with no arguments and a return type.

c)

3. Function with arguments and no return type.

d)

4. Function with arguments and with return type.

2.

Any two string handling function.

a)

strcpy( str1, str2)

b)

strcmd()

c)

strcpy()

d)

strcmp(str1, str2)

3.

#include<stdio.h>

#include<math.h>

int main() {

float n, ceilVal;

printf(" Enter any S-23 4M Numeric element : ");

scanf("%f", &n);

ceilVal = ceil(n);

printf("\n The Value of %.2f = %.4f ", n, ceilVal);

return 0;

}

IN ABOVE CODE WHICH MATH FUNCTION IS USE...?

a)

sqrt ()

b)

POW()

c)

ceil()

d)

strlen()

4.

Fibonacci series sequence....?

a)

0 1 2 3 4 5 6 7

b)

0 1 1 2 3 5 8 13

c)

2 3 4 5 6 7 8 8

d)

0 1 1 2 3 3 4 8 13

5.

State any two advantages of function.?

a)

1) Big code can be diffict to read, so when divided into smaller functions, it increases readability.

2 2) Program becomes modul.

b)

1) Big code can be difficult to read, so when divided into smaller functions, it increases readability.

2) Program becomes modular.

c)

1) Big code can be difficult to read, so when divi nto smaller functions, it increases readbty.

2) Program becomes moalr.

d)

1) Big code can be difficult to re, so when divided into smler func, it increases readability. 2) Program bemes modular.

6.

When function is called by passing values then it is _____?

a)

call by reference

b)

call by function

c)

call by pointer

d)

call by value

7.

No copy is generated for actual variable rather address of actual variable is passed.

a)

call by pointer

b)

Call by value

c)

call by function

d)

Call by reference

8.

Copy of actual variable is created when function is called.

a)

Call by reference

b)

call by pointer

c)

call by function

d)

Call by value

9.

Example:-

Function call - Swap ( x,y);

a)

strlen()

b)

strcpy()

c)

Call by reference

d)

Call by value

10.

Original (actual) parameters do not change.

a)

strcpy()

b)

strlen()

c)

Call by value

d)

ceil()

11.

Function call – Swap ( &x, &y );

a)

strcmd()

b)

call by value

c)

strlen()

d)

Call by reference

12.

Actual parameters change as function

a)

call by value

b)

sqrt()

c)

call by reference

d)

ceil()

13.

Syntax: strlen(str);

a)

Used to copy two strings

b)

Used to join two strings

c)

Used to find length of the string

d)

Used to override two strings

14.

Syntax: strcat(str1, str2);

a)

Used to find the string

b)

Used to find length of the string

c)

Used to copy length of the string

d)

Used to join two strings

15.

recursion two advantages.

a)

1.Reduces string of the program

2.Reduces unnecessary functions

b)

1.Reduces program output

2.Reduces unnecessary data.

c)

1.Reduces length of the program

2.Reduces unnecessary calling of a function

d)

1.Used to find length of the string

2.Used to join two strings

16.

It is function from stdio.h header file. This function is used to input a single character. The enter key is pressed which is followed by the character that is typed. The character that is entered is echoed.

a)

putchar( ) ;

b)

char( ) ;

c)

getchar( ) ;

d)

arr( ) ;

17.

A function that calls itself repeatedly, either directly or indirectly, until it reaches its base case is known as a____

a)

pointer function

b)

recursive function

c)

reccurrsive function

d)

string function

18.

The name "malloc" stands for____

a)

memory Read.

b)

memory deallocation.

c)

memory allocation.

d)

memory write.

19.

The name "calloc" stands for___

a)

datatype allocation.

b)

contiguous allocation.

c)

memory allocation.

d)

space allocation.

20.

#include<stdio.h>

#include<conio.h>

void findReverse();

void main()

{

findReverse();

}

void findReverse()

{

int num, res=0,ans=0;

clrscr();

printf("Enter the number");

scanf("%d", &num);

while(num!=0) {

res=num%10;

ans=ans*10+res;

num=num/10;

}

printf("Reverse number is %d", ans);

getch();

}

a)

code of reverse the pointer

b)

code of reverse the string

c)

code of reverse the number

d)

code of reverse the function