wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

may 30

Total questions: 10

Worksheet time: 10mins

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)
3.
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.
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.
5.
In which order do the following gets evaluated
1.Relational
2.Arithmetic
3.Logical
4.Assignment
a)
2134
b)
1234
c)
4321
d)
3214
6.
How will you print \n on the screen?
a)
printf("\n");
b)
echo "\\n";
c)
printf('\n');
d)
printf("\\n");
7.
What will be the output of the program?
a)
128
b)
Garbage value
c)
Error
d)
0
9.
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>
9.
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>
10.
The modulus operator cannot be used with a long double.
a)
True
b)
False