PPSC Computer Science Chapter 8 C Programming Online Test With Answers

PPSC Computer Science Chapter 8 C Programming Online Test

Sr. # Questions Answers Choice
1 'C' is a middle level language because. It is evolved in Middle age of computer development. Not having so many features but still is robust Easier to learn and use Combines the best features of high low level languages.
2 # define preprocessors command can be used for defining. Macros For loop Symbolic constants Both a and c
3 Malloc ( ) function return pointer to. Integer Void Character Structure
4 String concatenating means. Combining two strings. Extracting a substring out of a string. Merging two strings. Comparing the two string to define the larger one.
5 Element of the array are accessed by Index Mathematical function Accessing the function in built in data structure. Int l;
6 To most widely used method for interpreting the bit setting as non negative integer is. EBCD system BCD system ASCII system Binary number system
7 The function sprint f ( ) works like print f ( ), but operates on. Data file String Stderr Stdin
8 The function fprint is used in the program. 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
9 Which of the following is a not a keyword in C langauge. Void Volatile Short Gatchar
10 It is necessary to declare the type of the function in the calling program if. The function return an integer The function retern an integer Function returning only the float values The function return a non integer value.
11 Array are passed as the arguments to a function by Value Reference Constant value Both a and b
12 The given statement FILE "fptr; 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
13 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;
Garbage and 7 7 and 3 3 and 7 3 and 3
14 What's wrong in the following statement provide K is a variable of type Int.
(k=2 , k <= 12, k++)
The increment should always be ++k The variable must always be the letter i when using a for loop The variable k can't be initialized The commas should be semicolons.
15 The type of the controlling expression of a switch statement can not be of the type Int Char Float Long
16 What's wrong in the statement ? (x == 4 && y == 5) ? (a=5):(b=6): The question mark should be an equal sign. The first semicolon should be a colon There are too many variables in the statement None of abvoe
17 Find teh output of the following program
void main (){
int i = ' hello";
print f (i):
}
Syntax error Runtime error h Hello
18 Which of the following is not a valid name for a C variable. Hairaj Hello _ raj Hello raj None of above
19 Which of the following is a LOOP statement of a C language. Repeat until For While -Do Do-while Both b and d above
20 The size of an int must be greater than or equal to that of a Long int Short int Float Char
Download This Set

Is this page helpful?