C & C++ Programming Multiple Choice Questions - Set 34

1.       The function used to read a character from a file that has been opened in read mode is
(A) putc                          (B) getc
(C) getchar                    (D) putchar
Answer: B
Explanation:
getc is used to read a character from a file that has been opened in read mode.
2.       The constructed datatype of C is known as
(A) Pointers                  (B) String
(C) Structure                 (D) Array
Answer: C
Explanation:
Structure is a constructed datatype of C
3.       Choose the correct one
(A) Address operator cannot be applied to register variables
(B) Address operator can be applied to register variables
(C) Use of register declaration will increase the execution time
(D) None of the above
Answer: D
Explanation:
A register access is much faster than a memory access, keeping the frequently accessed variables in the register will lead to faster execution of programs.
4.       Prime area in context of file system is defined as ................
(A) a memory area created by operating system
(B) an area into which data records are written
(C) the main area of a web page
(D) primary memory
Answer: B
5.       The two types of file structure existing in VSAM file are ................
(A) key sequenced structure, entry sequenced structure
(B) key sequence structure, exit sequenced structure
(C) entry sequence structure, exit sequenced structure
(D) sequential, random
Answer: C

6.       Which amongst the following expression uses bitwise operator?
(A) a++               (B) !a>5
(C) a|b                (D) a!=b
Answer: C
Explanation:
| is bitwise OR.
7.       Choose the directive that is used to remove previously defined definition of the macro name that follows it:
(A) # remdef                  (B) # pragma
(C) # undef                   (D) # define
Answer: C
Explanation:
The pre-processor directive #undef OKAY would cause the definition of OKAY to be removed from the system.
8.       If an integer needs two bytes of storage, then the maximum value of a signed integer is
(A) 216-1             (B) 215-1
(C) 216                (D) 215
Answer: B
Explanation:
If we use a 16 bit word length, the size of the integer value is limited to the range
-215 to 215-1
9.       Literal means
(A) a string                    (B) a string constant
(C) a character             (D) an alphabet
Answer: B
Explanation:
Literal means a string constant.
10.    Value of ix+j, if i,j are integer type and ix long type would be ..................
(A) integer                     (B) float
(C) long integer                        (D) double precision
Answer: C


Post a Comment

0 Comments