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 "x" and "y" are called Actual parameters Local variables Formal parameters Global variables
2 The arguments in main () function are known as. Program parameter Command line arguments Both a and b above None of these
3 To read the formatted input data from a file, which of the following function is used. Getchar () fgets() fscanf () scanf()
4 The declaration int (*a)[8] : is An array of pointers A pointer to an array A pointer to a function Function returning pointer
5 int *p[5] ; is used for Fixed row size and varying column size Fixed row size and fixed column size Varying row size and varying column size. For storing integers
6 The function used to position the file pointer in C is Fseekg () Seekg() Fseek() Seekf()
7 A parameters in a function definition are known as. Actual parameters Formal parameters Dummy parameters Optional parameters
8 The address of the starting element of an array is. 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
9 Identify the correct statement from the following statements. Typedef int integer Typedef int integer; Typedef int = integer : Typedef integer int ;
10 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")
Syntax Error 1 10 100
11 How many number of tokens are there in the following statement provided 'valeus' is an integer variable.
if value == 21)
3 4 5 6
12 In the statement # define , the symbol # must commence from Any where in any line <div>First character of that line</div> Any where out side of main () always. None of above
13 Which of the following is not a character constant. '\60 '/x 24' 'sum' 'A'
14 The function sprint ( ) works like print f ( ) , but operates on. Strings Data in a file Stderr Stdin
15 The function slower checks wither a character is in lowered case or not and hence it should return. The character in lower case The character itself Nothing 0 or 1
16 While working with the binary Strems for 'C' I/O file operations. Only the binary values can be read and can be written No character transition take place Character translation takes place Both a and b above
17 With the following declaration , the correct answer is.enum rgb (red = -1, green , blue) red = -1, green = -2, blue = -3 red = -1 , green = 0 blue = 1 red = -1 , green = 2 blue = 3 All above alternative are illegal declarations.
18 Which of the following operators has right to left associativity. ++ -- + = All a ,b and c above
19 If a = Oxaa and b = a << 1 then b = 2a b = a/2 a = b -1 b = a
20 The getchar () library function Returns a character when any key is pressed Return multiple characters when the keys are pressed Return multiple characters when the key are pressed followed by enter key Return a single character when the keys are passed followed by enter key
Download This Set

Is this page helpful?