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
Which of the following is not a correct variable type.
Choose an answer
Float
Real
Int
Double
Previous
Skip
Next
Question # 2
What is the fifth element of the array
Int a [3][4] ={1,2,3,4,5,6,7,8,9,10,11}
Choose an answer
4
5
6
7
Previous
Skip
Next
Question # 3
Malloc ( ) function return pointer to.
Choose an answer
Integer
Void
Character
Structure
Previous
Skip
Next
Question # 4
The number of arguments for realloc ( ) function is.
Choose an answer
0
1
2
3
Previous
Skip
Next
Question # 5
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
Question # 6
The size of an int must be greater than or equal to that of a
Choose an answer
Long int
Short int
Float
Char
Previous
Skip
Next
Question # 7
Which of the following functions are used in unformatted data files.
Choose an answer
Fscanf
Fwrite
Fread
fscanf & fwrite
Previous
Skip
Next
Question # 8
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 # 9
An example of a value parameter is the code above is.
Choose an answer
x
y
c
foo
Previous
Skip
Next
Question # 10
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 # 11
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 # 12
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 # 13
Which of the following function calculates the square of 'X' in C.
Choose an answer
sr (X)
Pow (2,X)
Pow(X,2)
None of above
Previous
Skip
Next
Question # 14
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 # 15
What is the reslutl of the expression 6+12*3 -4/2?
Choose an answer
22
25
40
45
Previous
Skip
Next
Question # 16
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 # 17
What is the meaning of self referential structure.
Choose an answer
Array of structure
Single structure
Structure calling it's parent structure.
Structure calling another structure.
Previous
Skip
Next
Question # 18
Which of the following operators has right to left associativity.
Choose an answer
++
--
+ =
All a ,b and c above
Previous
Skip
Next
Question # 19
The function used to position the file pointer in C is
Choose an answer
Fseekg ()
Seekg()
Fseek()
Seekf()
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
Question # 21
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
Back