wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz on Datatypes_Header file_C Pgm Structure

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.
We want to store an integer number. Which of the following is correct statement?
a)
Integer x;
b)
int x;
c)
Int x;
d)
float x;
2.
We want to store a decimal value. Which of the following is correct statement?
a)
float x;
b)
int x;
c)
char x;
d)
decimal x;
3.
Data types are used to store data. Which of the datatype has no value?
a)
float
b)
int
c)
char
d)
void
4.
Integers occupy 2 bytes in 16 bit computers. How many bytes will it occupy in 32 bit computer?
a)
4
b)
8
c)
16
d)
32
5.
How many bits are there in each byte?
a)
1
b)
16
c)
8
d)
2
6.
How many bytes will float data type occupy?
a)
2
b)
4
c)
8
d)
16
7.
Float data type occupies ________ bits of memory
a)
32
b)
64
c)
16
d)
128
8.
How many bytes will char data type occupy?
a)
1
b)
2
c)
4
d)
8
9.
In 16 bit computer int data type occupies 2 bytes. What is the smallest signed integer value that can be stored?
a)
-32765
b)
-32768
c)
-32767
d)
-32766
10.
In 16 bit computer int data type occupies 2 bytes. What is the highest signed integer value that can be stored?
a)
32765
b)
32768
c)
32767
d)
32766
11.
In 16 bit computer int data type occupies 2 bytes. What is the highest value of unsigned integer value that can be stored?
a)
32767
b)
32768
c)
65535
d)
65536
12.
How many bytes will long double data type occupy?
a)
4
b)
8
c)
10
d)
16
13.
The float data type occupies 4 bytes. How many decimal precision places does it provide?
a)
8 decimal places
b)
15 decimal places
c)
10 decimal places
d)
6 decimal places
14.
The float data type gives 6 decimal places. How many decimal precision places does double data type provide?
a)
19 decimal places
b)
15 decimal places
c)
10 decimal places
d)
6 decimal places
15.
The double data type gives 15 decimal places. How many decimal precision places does long double data type provide?
a)
19 decimal places
b)
15 decimal places
c)
10 decimal places
d)
6 decimal places
16.
Format specifiers are used with printf and scanf. These specifiers start with which opeartor?
a)
$
b)
&
c)
%
d)
#
17.
Which of the following format specifier is used to represent integer data type?
a)
%f
b)
%d
c)
%ld
d)
%c
18.
Which of the following format specifier is used to represent floating point datatype?
a)
%f
b)
%d
c)
%ld
d)
%c
19.
Which of the following format specifier is used to represent double datatype?
a)
%f
b)
%lf
c)
%ld
d)
%d
20.
Which of the following format specifier is used to represent long int data type?
a)
%f
b)
%lf
c)
%ld
d)
%d
21.
Which of the following format specifier is used to represent char data type?
a)
%f
b)
%d
c)
%c
d)
%s
22.
Which of the following format specifier is used to represent string data type?
a)
%f
b)
%d
c)
%c
d)
%s
23.
Which of the following is a valid definition section statement
a)
#define A=3.74
b)
#define A 3.74
c)
#define A 3.74;
d)
#define A "3.74";
24.
Header files belong to which section of the C Program
a)
Link Section
b)
Definition Section
c)
Global Declaration Section
d)
Documentation Section
25.
A c program uses printf and scanf functions. Which header file much be included?
a)
stdlib.h
b)
stdio.h
c)
conio.h
d)
stdarg.h