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 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 # 2
The storage class controls
Choose an answer
Life time of a variable
Linkage of a variable
Scope of a variable
a , b and c above
Previous
Skip
Next
Question # 3
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 # 4
Which of the following is an advantage of using macros over functions.
Choose an answer
Functions must have parameters, macros do not
The code associated with a function is expanded in line
Values passed to function must be of specific data type
The code associated with a function is not expanded in line.
Previous
Skip
Next
Question # 5
The function fprint is used in the program.
Choose an answer
When too + many print calls have been used in the program.
In place of printf , as it uses more memory
When the type of the variables to be printed are not known
When the output is to be printed on to a file
Previous
Skip
Next
Question # 6
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 # 7
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 # 8
Given b=110 and c =20, what is the value of 'a' after execution of the expression a = b -= c + =5?
Choose an answer
10
450
110
-10
Previous
Skip
Next
Question # 9
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 # 10
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 # 11
How many number of tokens are there in the following statement provided 'valeus' is an integer variable.
if value == 21)
Choose an answer
3
4
5
6
Previous
Skip
Next
Question # 12
Which of the following functions are used in unformatted data files.
Choose an answer
Fscanf
Fwrite
Fread
fscanf & fwrite
Previous
Skip
Next
Question # 13
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 # 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
Information will be passed to the function via special identifier is called.
Choose an answer
Arguments
Parameters
Both A and B above
Elements
Previous
Skip
Next
Question # 16
The given statement of FILE * fptr,
Choose an answer
Defines a pointer to the pre defined structure type FILE
Define a pointer to the user defined structure type FILE.
define a pointer to the pre defined data type FILE DESCRIPTOR
Creates a file pointed by fptr
Previous
Skip
Next
Question # 17
The function sprint f ( ) works like print f ( ), but operates on.
Choose an answer
Data file
String
Stderr
Stdin
Previous
Skip
Next
Question # 18
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 # 19
What is the output of the following program.
#include <studio. h>
int c [10]={1,2,3,4,5,6,7,8,9,10}
main ()
{int a, b =0:
for {a<10;++a)
if c[a]:
[romt f (%d" . n);}
Choose an answer
20
24
25
30
Previous
Skip
Next
Question # 20
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 # 21
The getchar ()function reads a
Choose an answer
String from a file
Character from a file
String from the key board
Character from the keyboard
Previous
Skip
Next
Back