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
The arguments in main () function are known as.
Choose an answer
Program parameter
Command line arguments
Both a and b above
None of these
Previous
Skip
Next
Question # 2
If a = Oxaa and b = a << 1 then
Choose an answer
b = 2a
b = a/2
a = b -1
b = a
Previous
Skip
Next
Question # 3
The getchar () library function
Choose an answer
Returns a character when any key is pressed
Return multiple characters when the keys are pressed
Return multiple characters when the key are pressed followed by enter key
Return a single character when the keys are passed followed by enter key
Previous
Skip
Next
Question # 4
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 # 5
Multiple macro can be defined by placing _____ at teh end of each line except the last.
Choose an answer
/
\
#
$
Previous
Skip
Next
Question # 6
Element of the array are accessed by
Choose an answer
Index
Mathematical function
Accessing the function in built in data structure.
Int l;
Previous
Skip
Next
Question # 7
A parameters in a function definition are known as.
Choose an answer
Actual parameters
Formal parameters
Dummy parameters
Optional parameters
Previous
Skip
Next
Question # 8
How many characters can is string hold when declared as char name [20];?
Choose an answer
18
19
20
21
Previous
Skip
Next
Question # 9
Suppose the return type of function f is void. Which one of the following statements is true.
Choose an answer
Function f does not contain a return statement.
Function f does not have parameters
Function f return a generic value
Function f does not work correctly
Previous
Skip
Next
Question # 10
Which is the following is not a storage class in C.
Choose an answer
Auto
Struct
Extern
Static
Previous
Skip
Next
Question # 11
With the following declaration , the correct answer is.enum rgb (red = -1, green , blue)
Choose an answer
red = -1, green = -2, blue = -3
red = -1 , green = 0 blue = 1
red = -1 , green = 2 blue = 3
All above alternative are illegal declarations.
Previous
Skip
Next
Question # 12
It is necessary to declare the type of the function in the calling program if.
Choose an answer
The function return an integer
The function retern an integer
Function returning only the float values
The function return a non integer value.
Previous
Skip
Next
Question # 13
The type of the controlling expression of a switch statement can not be of the type
Choose an answer
Int
Char
Float
Long
Previous
Skip
Next
Question # 14
To most widely used method for interpreting the bit setting as non negative integer is.
Choose an answer
EBCD system
BCD system
ASCII system
Binary number system
Previous
Skip
Next
Question # 15
Which of the following functions are used in unformatted data files.
Choose an answer
Fscanf
Fwrite
Fread
fscanf & fwrite
Previous
Skip
Next
Question # 16
String concatenating means.
Choose an answer
Combining two strings.
Extracting a substring out of a string.
Merging two strings.
Comparing the two string to define the larger one.
Previous
Skip
Next
Question # 17
What is the output of the above program.
Choose an answer
5
8
Runtime error
Syntax error
Previous
Skip
Next
Question # 18
To read the formatted input data from a file, which of the following function is used.
Choose an answer
Getchar ()
fgets()
fscanf ()
scanf()
Previous
Skip
Next
Question # 19
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 # 20
Which one of the following will read a character from the keyboard and will store it in the variable.
Choose an answer
c = getc ()
getc (&c)
c = getchar ()
c = getchar (stdin)
Previous
Skip
Next
Back