Worksheetsc programming
Total questions: 50
Worksheet time: 25mins
Name
Class
Date
1.
Who is the father of C language?
a)
a) Steve Jobs
b)
b) James Gosling
c)
c) Dennis Ritchie
d)
d) Rasmus Lerdorf
2.
The C-preprocessors are specified with _________ symbol.
a)
a) #
b)
b) $
c)
c) ” ”
d)
d) &
3.
%d format specifier does
a)
used to print an integer value.
b)
used to print a string.
c)
used to display a character value.
d)
used to display a floating point value.
4.
Which of the following is not a valid C variable name?
a)
int number;
b)
float rate;
c)
int variable_count;
d)
int $main;
5.
Every statement in C should end with ________________.
a)
comma
b)
colon
c)
semicolon
d)
closing brace
6.
The ________ header file contains mathematical functions.
a)
math.h
b)
conio.h
c)
stdio.h
d)
stdlib.h
7.
In C language there are _____ number of keywords are available.
a)
32
b)
20
c)
30
d)
10
8.
String constants should be enclosed between ___
a)
double quotes
b)
parenthesis
c)
square brackets
d)
curly braces
9.
Arithmetic operator __________ cannot be used with floating point value
a)
%
b)
?:
c)
+
d)
-
10.
The ________operator is false only when both the operands are false.
a)
Logical OR
b)
Logical AND
c)
?:
d)
>>
11.
The symbol of Logical OR operator is __________
a)
&&
b)
||
c)
()
d)
[]
12.
sqrt() function is present in __________ header file.
a)
math.h
b)
stdio.h
c)
conio.h
d)
stdlib.h
13.
The control string ___________ is used in scanf() to read an character type variable.
a)
%f
b)
%d
c)
%c
d)
%x
14.
The keyword else cannot be used without ___________ keyword
a)
if
b)
default
c)
switch
d)
for
15.
In switch case ____________ keyword is used to exit from each block.
a)
break
b)
default
c)
switch
d)
case
16.
In ‘for loop’ which of the following statement is executed only one time?
a)
decrement
b)
increment
c)
testing
d)
initialization
17.
What is the size of the array int a[10];
a)
10 bytes
b)
20 bytes
c)
0 bytes
d)
5 bytes
18.
In C language, array is a ________ data type.
a)
fundamental datatype
b)
primitive datatype
c)
user defined datatype
d)
derived data type
19.
The_______is the syntax of declaring one dimensional array.
a)
datatype arrayname[size];
b)
arrayname datatype [size];
c)
arrayname[size];
d)
datatype [size];
20.
int a[10]; array can store maximum _____number of elements.
a)
10
b)
20
c)
9
d)
1
21.
The process of arranging the array elements in ascending or descending order is known as
a)
Sorting
b)
searching
c)
finding
d)
deletion
22.
In C language system, A string is a collection of ____________.
a)
characters
b)
integers
c)
floats
d)
symbols
23.
What is the size of the array int a[2][5];
a)
10 bytes
b)
20 bytes
c)
0 bytes
d)
5 bytes
24.
What is the maximum number of elements can be stored in the array int a[2][2];
a)
8
b)
4
c)
16
d)
30
25.
What is the maximum number of elements can be stored in the array int a[2][3][4];
a)
14
b)
24
c)
9
d)
10
26.
The process of finding the location of the specified element in a list is called _________
a)
declaration
b)
compilation
c)
initialization
d)
searching
27.
C language does not support ________datatype.
a)
string
b)
int
c)
char
d)
float
28.
In C language strings are represented as _______
a)
integer array
b)
character array
c)
zero
d)
float array
29.
In a string the last position is reserved for _____
a)
NULL characater
b)
row size
c)
column size
d)
row and column size
30.
Which format specification is used in scanf() to read a string?
a)
%d
b)
%ld
c)
%f
d)
%s
31.
Which amongst the header file contains gets ( ) function in C language.
a)
math.h
b)
string.h
c)
stdio.h
d)
process.h
32.
The function strcat ( ) has _______ number of parameters
a)
2
b)
1
c)
3
d)
0
33.
When 2 strings are equal strcmp() function returns _____.
a)
0
b)
1
c)
2
d)
-2
34.
The function strcpy(s2,s1) copies
a)
String s1 to s2
b)
String s2 to s1
c)
Does not copy
d)
error
35.
Which string function is used to determine the length of the string?
a)
strrev()
b)
strlen()
c)
strcmp()
d)
strcat()
36.
A function may be called __________from any other functions.
a)
only once
b)
only twice
c)
more than once
d)
only three times
37.
By default ________ is the return type of a C function.
a)
char
b)
float
c)
int
d)
double
38.
The ______ keyword is used to return a value from a function.
a)
return
b)
exit
c)
break
d)
void
39.
If a function does not return any value, the return type must be declared as _________.
a)
void
b)
int
c)
float
d)
char
40.
Which among the following keyword is used to define a structure?
a)
structure
b)
union
c)
struct
d)
structures
41.
The ______ is a collection of data of different data types under a single name.
a)
structure
b)
array
c)
loop
d)
switch
42.
Structure is a __________type of data type
a)
userdefined
b)
derived
c)
primitive
d)
fundamental
43.
The name of the data fields inside the structure is called _____________
a)
variables
b)
members
c)
data bank
d)
structure variable
44.
Which of the following are themselves a collection of different data types?
a)
string
b)
char
c)
structure
d)
array
45.
The size of _________is equal to the size of its largest member
a)
structure
b)
enum
c)
array
d)
union
46.
Which of the following cannot be a structure member?
a)
integer
b)
character
c)
another structure
d)
function
47.
Which among the following keyword is used to define a union?
a)
UNIONS
b)
union
c)
struct
d)
structures
48.
A pointer variable contains as its value the _______another variable.
a)
address
b)
variable name
c)
zero
d)
ampersand
49.
int a,*p; then which of the following statement is correct?
a)
&p=a;
b)
p=&a;
c)
p=a;
d)
a=p;
50.
The _____operator is used to get the address o f a variable.
a)
Ampersand(&)
b)
$
c)
@
d)
#
100 %
