More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
PPSC Computer Science Chapter 8 C Programming Online Test MCQs With Answers
Question # 1
If you declare an array without stating the elements it will be set to
Choose an answer
A null value
Zero
Garbage value
Set of words
Previous
Skip
Next
Question # 2
How would you declared constant of 5 called 'MYCONST"?
Choose an answer
Constant MYCONST =5
Int my const =5
# define MYCONST 5
#define MYCONST =5
Previous
Skip
Next
Question # 3
The function slower checks wither a character is in lowered case or not and hence it should return.
Choose an answer
The character in lower case
The character itself
Nothing
0 or 1
Previous
Skip
Next
Question # 4
Which command is used to skip the rest of a loop and carry on from the top of the loop again.
Choose an answer
Break
Resume
Continue
Skip
Previous
Skip
Next
Question # 5
Every C program consists of _____________ functions.
Choose an answer
Only one
Only two
One or many
None of the above
Previous
Skip
Next
Question # 6
Array are passed as the arguments to a function by
Choose an answer
Value
Reference
Constant value
Both a and b
Previous
Skip
Next
Question # 7
What are the values of a, b are if the following code fragemnt is executed int a , b = 7
a=b<4? b << 1, b> 4?7 >> 1 a;
Choose an answer
Garbage and 7
7 and 3
3 and 7
3 and 3
Previous
Skip
Next
Question # 8
C program language vas developed by.
Choose an answer
Dennis Ritchie
Ken thompson
Bill Gates
Peter Norton
Previous
Skip
Next
Question # 9
While declaring an array in C as datatype array name [size] the size can be.
Choose an answer
Any constant
An integer constant
Any variable
Any initialized integer variable
Previous
Skip
Next
Question # 10
Which of the following is "stringzizing operator"?
Choose an answer
$
%
#
?
Previous
Skip
Next
Question # 11
A function with no definition
Choose an answer
I san invalid function
Produces syntax error
Result into runtime error
Is allowed and is known as dummy function
Previous
Skip
Next
Question # 12
What's wrong in the following statement provide K is a variable of type Int.
(k=2 , k <= 12, k++)
Choose an answer
The increment should always be ++k
The variable must always be the letter i when using a for loop
The variable k can't be initialized
The commas should be semicolons.
Previous
Skip
Next
Question # 13
What is the associatively of the conditional operator.
Choose an answer
Left to Right
Right to left
Top to bottom
None of the above
Previous
Skip
Next
Question # 14
Multiple macro can be defined by placing _____ at teh end of each line except the last.
Choose an answer
/
\
#
$
Previous
Skip
Next
Question # 15
How is a variable accessed from another file.
Choose an answer
The global variable is reference via the extern specifier
The global variable is referenced via the auto specifier
The global variable is referenced via the global specifier
None of above
Previous
Skip
Next
Question # 16
The function sprint f ( ) works like print f ( ), but operates on.
Choose an answer
Data file
String
Stderr
Stdin
Previous
Skip
Next
Question # 17
What is the difference between a declaration and a definition of a variable.
Choose an answer
Both can occur multiple times but a declaration must occur first.
There is no difference between them
A declaration occurs once but a definition may occur many times.
Both can occur multiple times but a definition must occur first.
Previous
Skip
Next
Question # 18
The header file contains the function prototypes to the standard input /output library functions and information used by them.
Choose an answer
<std I/O .h>
<stdio .h>
< stdib.h>
<studio.h>
Previous
Skip
Next
Question # 19
Which of the following correctly access the seventh element stored in foo, an array with 100 elements.
Choose an answer
foo{6}:
Foo {7}:
Foo
Foo():
Previous
Skip
Next
Question # 20
What is the output of the above program.
Choose an answer
5
8
Runtime error
Syntax error
Previous
Skip
Next
Back