Font size
WorksheetsC Programming Quiz
Total questions: 110
Worksheet time: 2hrs 50mins
Developer of ‘C’ language is ______________.
Dennis Richie
Ken Thompson
Bill Gates
Peter Norton
C language developed in _________________.
1970
1972
1976
1980
C is ______ level language.
High
Low
Middle
Machine
C is available for which OS?
DOS
Windows
Unix
All of above
Which symbol is used for pre-processor statement?
!
#
~
;
Which of the following is a scalar data type?
Float
Union
Array
Pointer
Which of the following are tokens in C?
Keywords
Variables
Constants
All of above
Which is the valid range of “int” data type?
0 to 256
-32768 to +32767
-32767 to +32768
No particular range
Which symbol is used to terminate a statement?
!
#
~
;
Which escape sequence character is a line terminator?
\a
\b
\m
\n
Which escape sequence character is used to beep from speaker?
\a
\b
\m
\n
Character constants should be enclosed between ____________.
Single Quotes
Double Quotes
Both A and B
None of these
String constants should be enclosed between ____________.
Single Quotes
Double Quotes
Both A and B
None of these
Which of the following is invalid?
‘ ’
“ ”
‘a’
‘abc’
The maximum length of a variable in C is ______________.
8
16
32
64
The maximum size of ‘float’ variable is ________________.
1 byte
2 bytes
4 bytes
8 bytes
The maximum size of ‘double’ variable is _______________.
1 byte
2 bytes
4 bytes
8 bytes
A declaration of float a; double b; occupies ________ of memory.
1 byte
6 bytes
10 bytes
12 bytes
The size of a string variable is __________.
1 byte
10 bytes
20 bytes
Not specific
Which is an example of compounded assignment statement?
a=5
a=b
a=b=c
a+=10
The operator && is used for ________.
Value assignment
Increment by 1
Logical comparison
Condition Checking
The operator & is used for _________.
Bitwise AND
Logical AND
Pointer to the variable
None of these
The equality operator is represented by _________.
:=
.EQ
=
==
Operator’s precedence determines which operator is ____________.
Faster
Take no argument
Take less memory
Evaluated first
The bitwise AND is used for _______________.
Masking
Comparison
Division
Shifting bits
The operator << is used for ________________.
Shifting bits to left
Equality Checking
Shifting bits to right
None of these
Which of the following has the HIGHEST precedence?
*
==
=>
+
The associability of = operator is ________.
Right to Left
Left to Right
None of these
All of above
Which operator has LOWEST priority?
++
%
||
()
Which operator has HIGHEST priority?
()
||
%
++
Integer Division results in ___________.
Truncating the fractional part
Rounding the fractional part
Floating value
An error is generated
Which is a Ternary Operator?
? :
*
sizeof
^
The typecast operator is ____________.
cast ()
(data type)
//
“ ”
Explicit type conversion is known as ___________.
Separation
Conversion
Casting
Disjunction
a+=4 means ____________.
a=a+4
a=4
a+4=a
a=4+4
p++ executes faster than p=p+1 because ______________________.
p uses registers
++ is faster than +
p++ is a single instruction
All of above
Which statement is correct?
C Library functions provide I/O facilities
C inherent I/O facilities
C doesn’t have I/O facilities
Both (a) and (c)
Header files in C contain ___________.
Compiler Commands
Header information of C Programs
Library functions
Operators for files
Which pair is used for single character I/O.?
getchar() and putchar()
scanf() and printf()
input() and output()
None of these
The printf() returns __________ value when an error occurs.
Positive value
Zero
Negative Value
None of these
Identify wrong statement:
putchar(65)
putchar(“x”)
putchar(‘x’)
putchar(‘\n’)
An Ampersand in scanf() before the name of a variable denotes ___________.
Actual Value
Variable Name
Address
Data Type
Symbolic constants can be defined using _____________.
#define
symbols
const
None of these
Null character is represented by _____________.
\n
\0
\o
\e
Which header file is essential for using strcmp() function?
Null character is represented by _____________.
\n
\0
\o
\e
Which header file is essential for using strcmp() function.?
string.h
strings.h
text.h
strcmp.h
malloc() used in Dynamic Memory Allocation is available in ____________.
stream.h
malloc.h
alloc.h
stdio.h
Testing & Conversion character functions in C are available in ____________.
ctype.h
string.h
math.h
conio.h
C supports ________ Looping statements.
5
3
6
8
A statement differs from an expression by terminating with a _________.
Semicolon (;)
Colon (:)
NULL
dot (.)
Which of the following is an unconditional control structure?
Do-while
if-else
goto
for
Which of the following is a keyword is used for a storage class.?
printf
external
auto
scanf
In C language ‘a’ represents ______________________.
a digit
an integer
a character
a word
The number of Arithmetic operators in C language is ____________.
4
5
6
7
How many keywords are available in ‘C’?
32
34
36
30
Advantage of UNION over STRUCTURE is _______________.
Memory Storage
Memory Location
Memory Screen
None of these
Maximum number of elements in the array declaration “ int arr[5][8]; ” is ________.
28
32
35
40
Array subscripts in C always start at __________.
1
-1
as per programmer
0
Which is the correct way to declare a pointer?
int ptr;
*int *ptr;
int *ptr;
*int ptr;
Output of the printf(“2.3f\n”,17.23478) will be _____________.
17.23478
17.235
17.2348
17.23
What will be the value of the following: 1. floor(5.8) 2. floor(-5.8)
-5,-6
5, -6
5,6
-5,6
What would be the value of X after execution of the following statements? int x,y=10; char z=’a’; x=y+z;
Invalid
17
10a
107
What will be the output the following:
#include
93
92
91
90
Study the following program:
#include
7
5
2
None of above
A ________ operator applies to two operands, while a _______ operator applies to a single operand.
Binary, Unary
Ternary, Binary
Unary, Ternary
None of these
A ________ is a place where we can store values. Size of INT is ____________ bits.
int, 2
variable, 2
int, 16
variable, 16
Variable consist of letters, numbers and _________________. You can’t use ___________.
Underscore, keyword
Identifier, keyword
Alphabets, underscore
Underscore, identifier
Study it:
#include
10
9
11
12
What will be the output of following program?
#include
i=5, k=5
i=4, k=4
i=5, k=4
i=4, k=5
Study the following program:
#include
b=4,c=6
b=3, c=6
b=3,c=8
b=4, c=8
Study the following program:
#include
12, 144
13, 144
13, 0
None of these
Study the following program:
#include
Three
Three Five Odd
Three Five Seven Odd
Three Five Seven
Study the following program:
#include
8
6
10
14
Study the following program:
#include
X=4
X=20
X=25
X=10
What will be the output of this program? int i=0, X=0; while (i<20) { if(i%5==0) { X+=i; } i++; } printf(“X=%d”, X);
X=30
X=20
X=25
X=10
What will be the output of above program? int i, n=2; for(i=0; i<2; i++) { if(!(i<=n) && (++n==i)) n=n+2; else n=n-2; }
3
4
2
None of these
Symbol of Magnetic Tape is
Which is not a symbol of Flow-Chart.?
Pre-programming technique is.??
Flow Chart
Algorithm
Dry Run
All of Above
Which is the step by step representation of program creation?
Algorithm
Dry Run
None of Above
Dry Run is a __________.
Tabular Development
Step by Step Development
Graphical Representation
None of Above
‘B’ language is developed by___________.
Martin Richards
Dennis Ritchie
Ken Thompson
Berian Kerningham
Which of the following symbol is use for single line comment?
//
\\
/* ...... */
;
Which is not the graphical representation of program creation?
Algorithm
Flow Chart
Dry Run
(A) and (B) both
ANSI C permits the use of as many as ________ case labels.
258
259
257
256
Structure template is terminated by symbol _____________.
Semicolon ( ; )
Comma ( , )
Space ( )
Underscore ( _ )
? : is ______________ operator.
Logical
Bitwise
Assignment
Conditional
Which symbols used to define an array?
[ ]
{ }
< >
( )
Find the error: void main() { int a=11 ; if(a>0); printf(“Its POSITIVE”); else printf(“Its NEGATIVE”); }
getch(); is missing
misplaced else
statement missing
None of above
Which is a relational operator?
&&
>=
? :
/* ...... */
To check whether string is in upper case or not, which function is used?
toupper ()
upper ()
isupper()
None of above
pow(), abs() & sqrt() are situated in ______________ header file.
stdio.h, math.h, ctype.h
ctype.h
string.h
math.h
Which is not the part of UDF?
Prototype of Function
Definition of Function
Calling of Function
None of above
How compare that two strings are equal or not?
strcmp()
strcat()
strrev()
strchr()
Which is a storage class?
auto
static
register
All of above
64 bits occupied by which data type?
double
long double
unsigned int
int
Which special symbol is allowed for variable declaration ____________?
Under Score ( _ )
Caret ( ^ )
Tiled ( ~ )
Colon ( : )
< , > are used for __________________.
Function Call
Array
Link to Header file
Function Definition
Percentage style of “unsigned int” is ____________.
%ld
%c
%u
%lu
______________as an alternative of simple if...else statement.
Conditional Operator
? : Operator
Ternary Operator
All of above
Which is not an Entry Control.?
for loop
do...while loop
while loop
All of above
How many types of operators are there?
7
9
10
8
What is the output of below program? int a=11,b ; b=a++ printf(“\n\t B: %d”, b);
Error
12
11
None of above
a -=b is equivalent to ________________.
a=b-a
b=b-a
a=a-b
b=a-b
{ } are used to group statements together as in a function, or in the body of a loop. Such a grouping is known as _________________.
Statement
Block
Loop
Process
Which is the Escape Sequence character?
\n
\a
\o
(A) and (B) both
Null character is represented by ___________.
NULL
\0
\o
All of above
_________ Symbol behaves as STYLE while using with one variable and as REMINDER while using with two variable/values.
&
%
*
#
_____ and _____ are used to test more than one condition.
&&, ||
<=, >=
==, !=
<, >
