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
Multiple macro can be defined by placing _____ at teh end of each line except the last.
Choose an answer
/
\
#
$
Previous
Skip
Next
Question # 3
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 # 4
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 # 5
What is the only function all C program must contain.
Choose an answer
Start ()
System ()
Main ()
Program ()
Previous
Skip
Next
Question # 6
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 # 7
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 # 8
Which of the following is not a valid name for a C variable.
Choose an answer
Hairaj
Hello _ raj
Hello raj
None of above
Previous
Skip
Next
Question # 9
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 # 10
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 # 11
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 # 12
Find teh output of the following program
void main (){
int i = ' hello";
print f (i):
}
Choose an answer
Syntax error
Runtime error
h
Hello
Previous
Skip
Next
Question # 13
The address of the starting element of an array is.
Choose an answer
Represented by subscripted variable of the starting element.
Represented by the array name
Not used by the compiler
Represented by the size of the array
Previous
Skip
Next
Question # 14
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 # 15
An example of a value parameter is the code above is.
Choose an answer
x
y
c
foo
Previous
Skip
Next
Question # 16
Every C program consists of _____________ functions.
Choose an answer
Only one
Only two
One or many
None of the above
Previous
Skip
Next
Question # 17
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 # 18
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 # 19
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 # 20
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 # 21
The function used to position the file pointer in C is
Choose an answer
Fseekg ()
Seekg()
Fseek()
Seekf()
Previous
Skip
Next
Back