NEW
Font size
S
M
L
XL
WorksheetsC Programming Intro
Total questions: 24
Worksheet time: 12mins
Name
Class
Date
1.
Whitespace character does not giveany visible mark, but occupies an area on the page. Which of the following does not result in to white space?
a)
\\' backslash
b)
'\n' newline
c)
'\v' vertical tab
d)
'\r' carriage return
2.
Keywords are predefined reserved words in c. Which of the following ia a set of keywords in c?
a)
no, for, do
b)
true, while, constant
c)
do, for, if
d)
type, float, int
3.
Which keyword is used to prevent any changes in the variable within a C program?
a)
static
b)
const
c)
constant
d)
fixed
4.
A programmer has declared the variables as
int A = 9;
float a = 9.6;
Which of the following statement is correct
a)
Value in A will be 9.6
b)
Output depends on compiler
c)
Invalid declaration. Error
d)
Valid declaration. No error
5.
What is the result of the following
const int i = 3.67;
i = i + 3;
a)
3.67
b)
6.67
c)
6
d)
Error
6.
What value is stored in x, if its is declaed as
int i = 3.67;
a)
3.67
b)
"3.67"
c)
3
d)
4
7.
What is short int in C programming?
a)
The basic data type of C
b)
Qualifier
c)
Short is the qualifier and int is the basic data type
d)
All the above
8.
Programs written in few languages are executable on any machine. Such laguages are called as ___________
a)
Simple Language
b)
Structured Program
c)
Recursive Program
d)
Portable Language
9.
Group of instructions written to perform a task is called as_______.
a)
information
b)
comment
c)
array
d)
program
10.
c language has few backslash constants used for special purpose. They are also known as _________
a)
Free squence
b)
Escape sequence
c)
Exit Sequence
d)
Entry Sequence
11.
\n is a backslash constant for ________
a)
Vertical Tab space
b)
Horizontal Tab Space
c)
Form Feed
d)
New Line
12.
\t' is a backslash constant for ________
a)
Vertical Tab space
b)
Horizontal Tab Space
c)
Form Feed
d)
New Line
13.
\v is an escape sequence for _________
a)
Vertical Tab space
b)
Horizontal Tab Space
c)
Form Feed
d)
New Line
14.
\0 represents _________________
a)
Zero
b)
Null Character
c)
Division by Zero
d)
void data type
15.
As per C language standard, which of the following are not keywords? Pick the best statement.
int, when, make, elseif, sizeof
a)
when, make, elseif
b)
int, sizeof
c)
when, sizeof
d)
make, int, sizeof
16.
Each keyword is meant to perform a specific function in a C program. Keywords are also called as __________.
a)
Compiled words
b)
Reserved Words
c)
Constant Words
d)
Dumb Words
17.
Keywords are pre-defined words in a C compiler. How many keywords are in C.
a)
30
b)
31
c)
32
d)
33
18.
Keywords are pre-defined words in a C compiler. Keywords are written in ____________ case letters
a)
upper
b)
lower
c)
either lower or upper
d)
combined lower and upper
19.
Which o fthe following is a illegal variable name?
a)
update
b)
update_1
c)
Update
d)
1_update
20.
What is an array of characters, that end with a null character called?
a)
constant
b)
String
c)
Keyword
d)
Varaiable
21.
Which special symbol is used in arrays for specifying the subscript?
a)
{ }
b)
[ ]
c)
( )
d)
< >
22.
What is the problem in following variable declaration?
float 3Bedroom-Hall-Kitchen?;
a)
The variable name begins with an integer
b)
The special character ‘-‘
c)
The special character ‘?’
d)
All the above
23.
Which of the following is not a valid variable name declaration?
a)
float PI = 3.14;
b)
double PI = 3.14;
c)
int PI = 3.14;
d)
#define PI 3.14
24.
Which is valid C expression?
a)
int my_num = 100,000;
b)
int my_num = 10000;
c)
int my num = 1000;
d)
int my(num) = 10000;
Reset
