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 The given statement of FILE * fptr, 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
2 While declaring an array in C as datatype array name [size] the size can be. Any constant An integer constant Any variable Any initialized integer variable
3 What is the meaning of self referential structure. Array of structure Single structure Structure calling it's parent structure. Structure calling another structure.
4 How is a variable accessed from another file. The global variable is reference via the extern specifier The global variable is referenced via the auto specifier The global variable is referenced via the global specifier None of above
5 What does the "auto" specifier do. 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
6 Which one of the following will read a character from the keyboard and will store it in the variable. c = getc () getc (&c) c = getchar () c = getchar (stdin)
7 Which one of the following will declare a pointer to an integer at address 0 x 200 in memory. int " x, " x = 0 x 200; int " x, = & 0 x 200; int " x, = "0 x 200; int " x, = 0 x 200
8 What is the difference between a declaration and a definition of a variable. 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.
9 What is the output of the above program. 5 8 Runtime error Syntax error
10 How many union members can be initialized. 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.
11 The number of arguments for realloc ( ) function is. 0 1 2 3
12 When function is recursively called all the automatic variable are stored in a. Stack Array Register Linked list
13 Which of the following function calculates the square of 'X' in C. sr (X) Pow (2,X) Pow(X,2) None of above
14 What is the base data type of a pointer variable by which the memory would be allocated to it. Int Float No data type Unsigned int
15 Given b=110 and c =20, what is the value of 'a' after execution of the expression a = b -= c + =5? 10 450 110 -10
16 Function have Local scope Block scope File scope Function scope
17 A function with no definition I san invalid function Produces syntax error Result into runtime error Is allowed and is known as dummy function
18 The storage class controls Life time of a variable Linkage of a variable Scope of a variable a , b and c above
19 Which operator from the following has the lowest priority. Assignment operator Division operator Common operator Conditional operator
20 The associativity of ++ operator is For arithmetic expression and For pointer expression For pointer expression and For pointer express in and
Download This Set

Is this page helpful?