wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Language Pre-Assessment

Total questions: 25

Worksheet time: 25mins

Name
Class
Date
1.
Which of the following is not a valid C variable name?
a)
int number;
b)
float rate;
c)
int variable_count
d)
int $main
2.
Which data type is most suitable for storing a number 65000 in a 32-bit system?
a)
signed short
b)
unsigned short
c)
long
d)
int
3.
The format identifier ‘%i’ is also used for _____ data type?
a)
char
b)
int
c)
float
d)
double
4.
What is the size of an int data type?
a)
4 byte
b)
8bytes
c)
Depends on compiler
d)
cannot be deter
5.
Which of the following cannot be checked in a switch case statement ?
a)
char
b)
int
c)
Enum
d)
float
6.
We cannot use String in the Switch case as label
a)
Yes
b)
No
7.
Nesting of if-else statements is allowed in C Programming.
a)
Yes
b)
No
8.
Continue statement is allowed inside the switch case statement ?
a)
Yes
b)
No
9.
For loop is _________.
a)
Function Controlled
b)
Entry Controlled
c)
Exit Controlled
d)
None
10.
Comment on the output of this C code?
 int main()
  {
 float f1 = 0.1;
  if (f1 == 0.1)
  printf("equal\n");
  else
  printf("not equal\n");
  }
a)
equal
b)
not equal
c)
depends on compiler
d)
None
11.
Which of the datatypes have size that is variable?
a)
int
b)
struct
c)
float
d)
double
12.
What is the size of float in a 32-bit compiler?
a)
2
b)
4
c)
8
d)
16
13.
Which data type is suitable for storing a number like?
  10.0000000001
a)
int
b)
float
c)
do
d)
both float & double 
14.
Predict output
  void main()
  {    
float x = 0.1;
  printf("%d, ", x);
  printf("%f", x);
  }
a)
0.100000 , junk value
b)
junk value, 0.100000
c)
0, 0.100000
d)
0, 0.999999
15.
What will be the data type of the result of the following operation?
 (float)a*(int)b/(long)c * (double)d
a)
int
b)
long
c)
float
d)
do
16.
What is the output of this C code?
int main()
{
int var = 010;
printf("%d", var);
}
a)
2
b)
8
c)
010
d)
10
17.
The value obtained in the function is given back to main by using ________ keyword?
a)
return
b)
static
c)
new
d)
volatile
18.
What will be the data type returned for the following function?
  int func()
  {
 return (double)(char)5.0;
  }
a)
char
b)
int
c)
double
d)
Return illegal
19.
functions can return structure in c?
a)
True
b)
False
20.
functions can return enumeration constants in c?
a)
True
b)
False
21.
Which keyword is used to prevent any changes in the variable within a C program?
a)
immuta
b)
mutable
c)
const
d)
vola
22.
The name of the variable used in one function cannot be used in another function?
a)
True
b)
False
23.
variable declared in a function can be used in main?
a)
True
b)
False
24.
 #include is called
a)
Preprocessor directive
b)
Inclusion directive
c)
File inclusion directive
d)
None
25.
 Preprocessor feature that supply line numbers and file names to compiler is called?
a)
Selective inclusion
b)
macro substitution
c)
Concatenation
d)
Line control