wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C PROGRAMMING TEST

Total questions: 33

Worksheet time: 29mins

Name
Class
Date
1.
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
a)
rem = 3.14 % 2.1;
b)
rem = modf(3.14, 2.1);
c)
rem = fmod(3.14, 2.1);
d)
Remainder cannot be obtain in floating point division
2.
How would you round off a value from 1.66 to 2.0?
a)
ceil(1.66)
b)
floor(1.66)
c)
roundup(1.66)
d)
roundto(1.66)
4.
Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.
a)
Yes
b)
No
4.
Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.
a)
Yes
b)
No
5.
Point out the error in the following program 
a)
No error
b)
display() doesn't get invoked
c)
display() is called before it is defined
d)
None of these
6.

Program is a list of_______________, written in a _______________________ to determines the behaviour of a machine.

a)

word, english

b)

instructions , programming language

c)

instructions, word

7.

A machine language that has its own set of grammatical rules is called as ___________________________

a)

intelligence languange

b)

robotic

c)

programming language

8.

C language was developed by Dennis Ritchie at Bell Laboratories in year_____________

a)

1963

b)

1972

c)

1969

9.

A flowchart is a graphical representation that helps programmer to develop algorithms in programming.

a)

True

b)

False

10.

A flowchart is a graphical representation that helps programmer to develop algorithms in programming.

a)

True

b)

False

11.

Process of writing the C source code is called as ___________________

a)

Editing

b)

LInking

c)

Executing

12.

C programming consists of two section which are _________________ and ___________________

a)

Pre-processor directives ; Main function

b)

Pre-processor directives ; end statement

c)

statements ; Main function

13.
Point out the error in the following program
a)
Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.
b)
Program terminates abnormally.
c)
No error
d)
None of these.
14.
In which order do the following gets evaluated
1.Relational
2.Arithmetic
3.Logical
4.Assignment
a)
2134
b)
1234
c)
4321
d)
3214
15.
The keyword used to transfer control from a function back to the calling function is
a)
switch
b)
goto
c)
go back
d)
return
16.
What will be the output of the program?
a)
Hello
b)
Hi Hello
c)
No output
d)
Infinite loop
17.
What is (void*)0?
a)
Representation of NULL pointer
b)
Representation of void pointer
c)
Error
d)
None of above
18.
Point out the compile time error in the program given below.
a)
Error: invalid assignment for x
b)
Error: suspicious pointer conversion
c)
No error
d)
None of above
19.
If the two strings are identical, then strcmp() function returns
a)
-1
b)
1
c)
0
d)
yes
20.
How will you print \n on the screen?
a)
printf("\n");
b)
echo "\\n";
c)
printf('\n');
d)
printf("\\n");
21.
In which numbering system can the binary number 1011011111000101 be easily converted to?
a)
Decimal system
b)
Hexadecimal system
c)
Octal system
d)
None Of The Above
22.
What will be the output of the program?
a)
128
b)
Garbage value
c)
Error
d)
0
23.
In C, if you pass an array as an argument to a function, what actually gets passed?
a)
Value of elements in array
b)
First element of the array
c)
Base address of the array
d)
Address of the last element of array
24.
What is the similarity between a structure, union and enumeration?
a)
All of them let you define new values
b)
All of them let you define new data types
c)
All of them let you define new pointers
d)
All of them let you define new structures
25.
What function should be used to free the memory allocated by calloc() ?
a)
dealloc();
b)
malloc(variable_name, 0)
c)
free();
d)
memalloc(variable_name, 0)
26.
Which statement will you add in the following program to work it correctly?
a)
#include<conio.h>
b)
#include<math.h>
c)
#include<stdlib.h>
d)
#include<dos.h>
27.
We want to round off x, a float, to an int value, The correct way to do is
a)
y = (int)(x + 0.5)
b)
y = int(x + 0.5)
c)
y = (int)x + 0.5
d)
y = (int)((int)x + 0.5)
28.
Associativity has no role to play unless the precedence of operator is same.
a)
True
b)
False
29.
Functions cannot return more than one value at a time
a)
True
b)
False
30.
In C all functions except main() can be called recursively.
a)
True
b)
False
31.
The modulus operator cannot be used with a long double.
a)
True
b)
False
32.
A preprocessor directive is a message from programmer to the pre-processor.
a)
True
b)
False
33.
The modulus operator cannot be used with a long double.
a)
True
b)
False