C programs are converted into machine language with the help of
a.
An Editor
b.
A compiler
c.
An operating system
d.
None of these
Which one of the following is not a reserved keyword for C?
a.
auto
b.
case
c.
main
d.
default
Which of the following is not a correct variable type?
a.
float
b.
real
c.
int
d.
double
Which of the following cannot be checked in a switch case statement ?
a.
Character
b.
Integer
c.
Enum
d.
Float
Q57.
Which of the following is not an example of looping statement ?
a.
for
b.
do-while
c.
while
d.
switch
The _________ is a computer program that translates the source code into
corresponding object code
a.
Compiler
b.
Assembler
c.
COBOL
d.
Interpreter
.
An _______ is a fixed size sequence collection of elements of the same data
type
a.
integer
b.
function
c.
array
d.
pointer
What is the action of strcat() function
a.
compare two strings
b.
concatenates two strings
c.
finds the length of a string
d.
copies one string over another
Automatic variable also referred to as
a.
Internal variable
b.
Global variable
c.
Local variable
d.
External variable
All keywords in C are in
a.
LowerCase letters
b.
UpperCase letters
c.
CamelCase letters
Which of the following is not a pointer declaration?
a.
char a[10];
b.
char a[] = {‘1’, ‘2’, ‘3’, ‘4’};
c.
char *str;
d.
char a;
Relational operators cannot be used on:
a.
structure
b.
long
c.
strings
d.
float
Function tolower(c) defined in library works for
a.
Ascii character set
b.
Unicode character set
c.
Ascii and utf-8 but not EBSIDIC character set
d.
Any character set
Which type conversion is NOT accepted?
a.
From char to int
b.
From float to char pointer
c.
From negative int to char
d.
From double to char
Automatic variables are allocated space in the form of a:
a.
stack
b.
queue
c.
priority queue
d.
random
Which of the following is a storage specifier?
a.
enum
b.
union
c.
auto
d.
volatile
Which is an indirection operator among the following?
a.
&
b.
*
c.
->
d.
Which of the following cannot be a structure member?
a.
Another structure
b.
Function
c.
Array
d.
None of the mentioned
.
What is the difference between %e and %g?
a.
%e output formatting depends on the argument and %g always formats in the format
[-]m.dddddd or [-]m.dddddE[+|-]xx where no.of ds are optional.
b.
%e always formats in the format [-]m.dddddd or [-]m.dddddE[+|-]xx where
no.of ds are optional and output formatting depends on the argument.
c.
No differences
d.
Depends on the standard
FILE reserved word is?
a.
A structure tag declared in stdio.h
b.
One of the basic datatypes in c
c.
Pointer to the structure defined in stdio.h
d.
It is a type name defined in stdio.h
6) Which one of the following is a loop construct that will always be executed
once?
1. for
2. while
3. switch
4. do while
How many bytes does "int = D" use?
1. 0
2. 1
3. 2 or 4
4. 10
Each instance of a class has a different set of
1. Class interfaces
2. Methods
3. Return types
4. Attribute values
Array is a _________ data structure.
1. Non-linear
2. Primary
3. Linear
4. Data type
8) Who defines the user-defined function?
1. Compiler
2. Computer
3. Compiler library
4. Users
What type of data type does the atoi() function return?
1. String
2. char
3. Integer
4. Float
Which of the following is the address operator?
1. @
2. #
3. &
4. %
The programming language that has the ability to create new data types is called___.
1. Overloaded
2. Encapsulated
3. Reprehensible
4. Extensible
C++ is a ___ type of language.
1. High-level Language
2. Low-level language
3. Middle-level language
4. None of the above
Which of the following refers to the wrapping of data and its functionality into a
single individual entity?
1. Modularity
2. Abstraction
3. Encapsulation
4. None of the above
Which of the following functions must use the reference?
1. Copy constructor
2. Destructor
3. Parameterized constructor
4. None of the above
Increment (++) and decrement (--) are the ___ operators in
C?
A. Unary
B. Binary
C. Ternary
D. None of the above
. Which of these is an exit-controlled loop?
A. for
B. if
C. do...while
D. while
Which of the following is the collection of different data
types?
A. structure
B. string
C. array
D. All of the above
Which of these is a user-defined data type in C?
A. int
B. union
C. char
D. All of these
. Which of these is not a valid parameter passing method in
C?
A. Call by value
B. Call by reference
C. Call by pointer
D. All of these
Which is the correct syntax to declare a file pointer in C?
A. File *file_pointer;
B. FILE *file_pointer;
C. File file_pointer;
D. FILE *file_pointer;
What will happen if a header file is included in a program
twice?
A. Program will throw an error
B. Program will throw an exception
C. Program will run normally
D. None of these
What function should be used to free the memory allocated
by calloc() ?
E. A. dealloc();
B. malloc(variable_name, 0)
C. free();
D. memalloc(variable_name, 0)
What is stderr ?
F. A. standard error
B. standard error types
C. standard error streams
D. standard error definitions
The Packing of _____________ into single component is know as
encapsulation.
G. A. data
B. function
C. data and functions
D. none
4._______________loop will be executed at least once even if the
condition is false initially
H.A.do-while
B.while
C.for
D.none
5. What is dangling pointer in c
if pointer is pointing to a memory location from where variable
has been deleted
A. if pointer is assigned to more than one variable
B. if pointer is not defined properly
C. none of above
Mechanism of deriving a class from another derived class is known as____
A. Polymorphism
B. Single Inheritance
C. Multilevel Inheritance
D. Message Passing
. RunTime Polymorphism is achieved by ______
A. friend function
B. virtual function
C. operator overloading
D. function overloading
Which of the following cannot be legitimately passed to a function
A. A constant.
B. A variable.
C. A structure.
D. A header file.
. Exception handling is targeted at
A. Run-time error
B. Compile time error
C. Logical error
D. All of the above.
An exception is caused by
A. a hardware problem
B. a problem in the operating system
C. a syntax error
D. a run-time error
. A class defined within another class is:
A. Nested class
B. Inheritance
C. Containership
D. Encapsulation
What is the time complexity to print all N elements of any integer array
in C++?
(A) O(LogN)
(B) O(1)
(C) O(N)
(D) O(N longN)