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
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 # 2
The given statement FILE "fptr;
Choose an answer
Defines a pointer to the pre defined structure type FILE.
Defines a pointer to the usere defined structure type FILE
Defines a pointer to the pre-defined data type FILE DESCRIPTOR.
Creates a file pointed by fptr
Previous
Skip
Next
Question # 3
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 # 4
When a program is running the value of a constant
Choose an answer
Can be changed
Cannot be used
I always hidden
Cannot be changed
Previous
Skip
Next
Question # 5
If suppose a variable 'a' is initialized as int a = oxff, then what will be output for the below code.
(a << 4>>12)? printf ("Humaira') printf (" iram")
Choose an answer
Syntax Error
1
10
100
Previous
Skip
Next
Question # 6
How many union members can be initialized.
Choose an answer
Only one member of union at any one time.
Any number of members of a union at one time
Union members can not be initialized
Only two members of a union at any one time.
Previous
Skip
Next
Question # 7
The function 'foo' returns the following type as result.
Choose an answer
Ineger
No result is returned
Float
Double
Previous
Skip
Next
Question # 8
Multiple macro can be defined by placing _____ at teh end of each line except the last.
Choose an answer
/
\
#
$
Previous
Skip
Next
Question # 9
Which of the following is a LOOP statement of a C language.
Choose an answer
Repeat until
For
While -Do
Do-while
Both b and d above
Previous
Skip
Next
Question # 10
"c" is called.
Choose an answer
Actual parameter
Local variable
Formal parameter
Global variable
Previous
Skip
Next
Question # 11
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 # 12
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 # 13
What is the only function all C program must contain.
Choose an answer
Start ()
System ()
Main ()
Program ()
Previous
Skip
Next
Question # 14
Every C program consists of _____________ functions.
Choose an answer
Only one
Only two
One or many
None of the above
Previous
Skip
Next
Question # 15
The associativity of ++ operator is
Choose an answer
For arithmetic expression and
For pointer expression
For pointer expression and
For pointer express in and
Previous
Skip
Next
Question # 16
"x" and "y" are called
Choose an answer
Actual parameters
Local variables
Formal parameters
Global variables
Previous
Skip
Next
Question # 17
Which of the following is not a correct variable type.
Choose an answer
Float
Real
Int
Double
Previous
Skip
Next
Question # 18
In the statement # define , the symbol # must commence from
Choose an answer
Any where in any line
First character of that line
Any where out side of main () always.
None of above
Previous
Skip
Next
Question # 19
A function protoype is
Choose an answer
A definition of the function
a declaration statement in the called program
A declaration statement in the called program
A function call in the program
Previous
Skip
Next
Question # 20
Which of the following is a not a keyword in C langauge.
Choose an answer
Void
Volatile
Short
Gatchar
Previous
Skip
Next
Question # 21
What does the "auto" specifier do.
Choose an answer
It automatically initializes a variables to 0
It indicates that a variables memory will automatically be preserved
It automatically increments the variable when used.
It automatically initializes a variable to NULL
Previous
Skip
Next
Back