NEW
Font size
WorksheetsX-Tech Riot (2)
Total questions: 20
Worksheet time: 10mins
Which of the following symbol is used to declare the preprocessor directives in C++?
$
^
#
*
What is meant by a polymorphism in C++?
class having only single form
class having four forms
class having many forms
class having two forms
Which keyword is used to define the macros in c++?
#macro
#define
macro
define
Which of the following is used to terminate the function declaration in C++?
:
;
//
/>
What will be the output of the following C code snippet?
returns 1
returns 2
Varies
Compile time error
How many times i value is checked in the following C program?
1
3
4
5
What are the elements present in the array of the following C code?
int array[5] = {5};
5, (garbage), (garbage), (garbage), (garbage)
5,5,5,5,5
0,0,0,0,5
5,0,0,0,0
Comment on the output of following C code.
It will print a
It will print 0
Compile time error
Run time error
What will be the output of the following C++ code?
Hello
World
Error
Hello World
Which of the following correctly declares an array in C++?
array{10};
array array[10];
int array;
int array[10];
What will be the output of the following C++ code?
Segmentation fault
Nothing is printed
Error
cin: garbage value
What is abstract class in C++?
Any Class in C++ is an abstract class
Class from which any class is derived
Class specifically used as a base class with atleast one virtual functions
Class specifically used as a base class with atleast one pure virtual functions
Which concept allows you to reuse the written code in C++?
Inheritance
Polymorphism
Abstraction
Encapsulation
What is the benefit of c++ input and output over c input and output?
Both Type safety & Exception
Sequence container
Exception
Type safety
What will be the output of the following C++ code snippet?
21
27
25
26
What happens if the following program is executed in C and C++?
Error in both C and C++
Successful run in both C and C++
Error in C and successful execution in C++
Error in C++ and successful execution in C
What happens if the following program is executed in C and C++?
Error in both C and C++
Outputs Hello twice in both C and C++
Error in C and Outputs Hello twice in C++
Error in C++ and Outputs Hello twice in C
Which of the following feature is not provided by C?
Pointers
Structures
References
Functions
what will be the output of he following c++ code
2035645065
2035655065
2035655035
2035635065
what will be the output of the following c++ code?
10
30
compile time error
20
