Cancel Preloader
Unlimited Online Free Software Download! Get 100% Free
Hurry up!
Location: Bapunagar
Call: 800 053 0134
Email: info@hitechskillindia.in
Courses
CCC
Accounting
Software Development
Designing
Mobile Development
Digital Marketing
Specialized Courses
Live Project Training
Home
About
Placement Student's
Quiz
Level 1 Software Quiz
CCC Quiz
TallyPrime + GST Quiz
C, C++ Quiz
PHP Quiz
Python Quiz
Java Quiz
ASP.NET Quiz
Angular Quiz
React Quiz
Front-End Quiz
Fullstack Quiz
Flutter Quiz
Web Development Quiz
ASP.NET MVC Quiz
Web Design Quiz
iOS Quiz
Android Quiz
React Native Quiz
Digital Marketing Quiz
Advance Digital Marketing Quiz
.Net Core Quiz
WordPress Quiz
Magento Quiz
Joomla Quiz
NodeJS Quiz
Laravel Quiz
Blog
Contact
E-Brochure
hot
Gallery
Seminar
Career
We Are Hiring
Inquiry Now
Home
About Us
Courses
CCC
Accounting
Software Development
hot
Designing
Mobile Development
new
Digital Marketing
Specialized Courses
new
Live Project Training
hot
Placement Student's
Quiz
Software Development
Level 1 Software Quiz
CCC Quiz
TallyPrime + GST Quiz
C, C++ Quiz
PHP Quiz
Python Quiz
Java Quiz
ASP.NET Quiz
Angular Quiz
React Quiz
Front-End Quiz
Fullstack Quiz
Flutter Quiz
Web Development Quiz
ASP.NET MVC Quiz
Web Design Quiz
iOS Quiz
Android Quiz
React Native Quiz
Digital Marketing Quiz
Advance Digital Marketing Quiz
.Net Core Quiz
WordPress Quiz
Magento Quiz
Joomla Quiz
NodeJS Quiz
Laravel Quiz
Blog
Contact Us
More
New
E-Brochure
hot
Gallery
Seminar
Career
We Are Hiring
C & C++ Quiz
Home
Quiz
C & C++ Quiz
C & C++ Quiz
Welcome!
Quiz
Q.
1 What is the 16-bit compiler allowable range for integer constants ?
A.
-3.4e38 to 3.4e38
B.
-32767 to 32768
C.
-32668 to 32667
D.
-32768 to 32767
Answer
-32768 to 32767
Q.
2 What is required in each C program ?
A.
The program must have at least one function.
B.
The program does not require any function.
C.
Input data
D.
Output data
Answer
The program must have at least one function.
Q.
3 Which of the following comment is correct when a macro definition includes arguments ?
A.
The opening parenthesis should immediately follow the macro name.
B.
There should be at least one blank between the macro name and the opening parenthesis
C.
There should be only one blank between the macro name and the opening parenthesis.
D.
All the above comments are correct.
Answer
The opening parenthesis should immediately follow the macro name.
Q.
4 What is a lint ?
A.
C compiler
B.
Interactive debugger
C.
Analyzing tool
D.
C interpreter
Answer
Analyzing tool
Q.
5 What is the output of this statement ''printf(''%d'', (a++))'' ?
A.
The value of (a + 1)
B.
The current value of a
C.
Error message
D.
Garbage
Answer
The current value of a
Q.
6 Why is a macro used in place of a function ?
A.
It reduces execution time.
B.
It reduces code size.
C.
It increases execution time.
D.
It increases code size.
Answer
It reduces execution time.
Q.
7 In the C language, the constant is defined _______.
A.
Before main
B.
After main
C.
Anywhere, but starting on a new line.
D.
None of the these.
Answer
Anywhere, but starting on a new line.
Q.
8 A pointer is a memory address. Suppose the pointer variable has p address 1000, and that p is declared to have type int*, and an int is 4 bytes long. What address is represented by expression p + 2 ?
A.
1002
B.
1004
C.
1006
D.
1008
Answer
1008
Q.
9 Which one of the following is a loop construct that will always be executed once ?
A.
for
B.
while
C.
switch
D.
do while
Answer
do while
Q.
10 How many characters can a string hold when declared as follows ? char name[20]:
A.
18
B.
19
C.
20
D.
None of the these
Answer
20
Q.
11 Directives are translated by the
A.
Pre-processor
B.
Compiler
C.
Linker
D.
Editor
Answer
Pre-processor
Q.
12 How many bytes does **int = D** use ?
A.
0
B.
1
C.
2 or 4
D.
10
Answer
2 or 4
Q.
13 What is the maximum number of characters that can be held in the string variable char address line [40] ?
A.
38
B.
39
C.
40
D.
41
Answer
39
Q.
14 Which one is the correct description for the variable balance declared below ? int ** balance;
A.
Balance is a point to an integer
B.
Balance is a pointer to a pointer to an integer
C.
Balance is a pointer to a pointer to a pointer to an integer
D.
Balance is an array of integer
Answer
Balance is a pointer to a pointer to an integer
Q.
15 Which of the following statement is not true ?
A.
A pointer to an int and a pointer to a double are of the same size.
B.
A pointer must point to a data item on the heap (free store).
C.
A pointer can be reassigned to point to another data item.
D.
A pointer can point to an array.
Answer
A pointer must point to a data item on the heap (free store).
Q.
16 Let p1 be an integer pointer with a current value of 2000. What is the content of p1 after the expression p1++ has been evaluated ?
A.
2001
B.
2002
C.
2004
D.
2008
Answer
2004
Q.
17 Let p1 and p2 be integer pointers. Which one is a syntactically wrong statement ?
A.
p1 = p1 + p2;
B.
p1 = p1 - 9;
C.
p2 = p2 + 9;
D.
printf(**%d**,p1 - p2);
Answer
p1 = p1 + p2;
Q.
18 Suppose that cPtr is a character pointer, and its current content is 300. What will be the new value in cPtr after the following assignment ? cPtr = cPtr + 5;
A.
305
B.
310
C.
320
D.
340
Answer
305
Q.
19 Which is valid expression in C language ?
A.
int my_num = 100,000;
B.
int my_num = 100000;
C.
int my num = 1000;
D.
int my num == 10000;
Answer
int my_num = 100000;
Q.
20 If addition had higher precedence than multiplication, then the value of the expression (1 + 2 * 3 + 4 * 5) would be which of the following ?
A.
27
B.
47
C.
69
D.
105
Answer
105
Q.
21 Who is the father of C language ?
A.
Steve Jobs
B.
James Gosling
C.
Dennis Ritchie
D.
Rasmus Lerdorf
Answer
Dennis Ritchie
Q.
22 All keywords in C are in ____________
A.
LowerCase letters
B.
UpperCase letters
C.
CamelCase letters
D.
None of the mentioned
Answer
LowerCase letters
Q.
23 Which of the following is true for variable names in C ?
A.
FThey can contain alphanumeric characters as well as special characters
B.
It is not an error to declare a variable to be one of the keywords(like goto, static)
C.
Variable names cannot start with a digit
D.
Variable can be of any length
Answer
Variable names cannot start with a digit
Q.
24 Which of the following cannot be a variable name in C ?
A.
volatile
B.
true
C.
friend
D.
export
Answer
volatile
Q.
25 Which of the following declaration is not supported by C language ?
A.
String str;
B.
char *str;
C.
float str = 3e2;
D.
Both String str; & float str = 3e2;
Answer
String str;
Q.
26 Which keyword is used to prevent any changes in the variable within a C program ?
A.
immutable
B.
mutable
C.
const
D.
volatile
Answer
const
Q.
27 What is the result of logical or relational expression in C ?
A.
True or False
B.
0 or 1
C.
0 if an expression is false and any positive number if an expression is true
D.
None of the mentioned
Answer
0 or 1
Q.
28 Where in C the order of precedence of operators do not exist ?
A.
Within conditional statements, if, else
B.
Within while, do-while
C.
Within a macro definition
D.
None of the mentioned
Answer
None of the mentioned
Q.
29 What is an example of iteration in C ?
A.
for
B.
while
C.
do-while
D.
all of the mentioned
Answer
all of the mentioned
Q.
30 Functions can return enumeration constants in C ?
A.
true
B.
false
C.
depends on the compiler
D.
depends on the standard
Answer
true
Q.
31 Functions in C Language are always _________
A.
Internal
B.
External
C.
Both Internal and External
D.
External and Internal are not valid terms for functions
Answer
External
Q.
32 Which of following is not accepted in C ?
A.
static a = 10; //static as
B.
static int func (int); //parameter as static
C.
static static int a; //a static variable prefixed with static
D.
all of the mentioned
Answer
static static int a; //a static variable prefixed with static
Q.
33 Property which allows to produce different executable for different platforms in C is called ?
A.
File inclusion
B.
Selective inclusion
C.
Conditional compilation
D.
Recursive macros
Answer
Conditional compilation
Q.
34 What is #include ?
A.
Preprocessor directive
B.
Inclusion directive
C.
File inclusion directive
D.
None of the mentioned
Answer
Preprocessor directive
Q.
35 C preprocessors can have compiler specific features.
A.
True
B.
False
C.
Depends on the standard
D.
Depends on the platform
Answer
True
Q.
36 The C-preprocessors are specified with _________ symbol.
A.
#
B.
$
C.
""
D.
&
Answer
#
Q.
37 How many number of pointer (*) does C have against a pointer variable declaration ?
A.
7
B.
127
C.
255
D.
No limits
Answer
No limits
Q.
38 Which of the following is not possible statically in C language ?
A.
Jagged Array
B.
Rectangular Array
C.
Cuboidal Array
D.
Multidimensional Array
Answer
Jagged Array
Q.
39 which of the following return-type cannot be used for a function in C ?
A.
char *
B.
struct
C.
void
D.
none of the mentioned
Answer
none of the mentioned
Q.
40 When a C program is started, O.S environment is responsible for opening file and providing pointer for that file ?
A.
Standard input
B.
Standard output
C.
Standard error
D.
All of the mentioned
Answer
All of the mentioned
Q.
41 In C language, FILE is of which data type ?
A.
int
B.
char *
C.
struct
D.
none of the mentioned
Answer
struct
Q.
42 What is the sizeof(char) in a 32-bit C compiler ?
A.
1 bit
B.
2 bits
C.
1 Byte
D.
2 Bytes
Answer
1 Byte
Q.
43 scanf() is a predefined function in______header file.
A.
stdlib. h
B.
ctype. h
C.
stdio. h
D.
stdarg. h
Answer
stdio. h
Q.
44 C Language develop at______?
A.
AT & T's Bell Laboratories of USA in 1972
B.
AT & T's Bell Laboratories of USA in 1970
C.
Sun Microsystems in 1973
D.
Cambridge University in 1972
Answer
AT & T's Bell Laboratories of USA in 1972
Q.
45 C programs are convert into machine language with help of
A.
An Editor
B.
A compiler
C.
An operating system
D.
None of these.
Answer
A compiler
Q.
46 C was primarily Developed as
A.
System programming language
B.
General purpose language
C.
Data processing language
D.
None of the above.
Answer
System programming language
Q.
47 Standard ANSI C recongnizes________number of keyboards ?
A.
30
B.
32
C.
36
D.
24
Answer
32
Q.
48 C Language is a successor to which language ?
A.
FORTRAN
B.
D Language
C.
BASIC
D.
B Language
Answer
B Language
Q.
49 C is a which level language ?
A.
Low Level
B.
High Level
C.
Low + High
D.
None
Answer
High Level
Q.
50 Low level language is ?
A.
Human readable like language.
B.
language with big program size.
C.
language with small program size.
D.
Difficult to understand and readability is questionable.
Answer
Difficult to understand and readability is questionable.
Q.
51 High level language is a ?
A.
Human readable like language.
B.
language with small program size.
C.
language with big program size.
D.
language which is difficult to understand and not human readable.
Answer
Human readable like language.
Q.
52 C is _______ type of programming language ?
A.
Object Oriented
B.
Procedural
C.
Bit level language
D.
Functional
Answer
Procedural
Q.
53 Who invented C++ ?
A.
Dennis Ritchie
B.
Ken Thompson
C.
Brian Kernighan
D.
Bjarne Stroustrup
Answer
Bjarne Stroustrup
Q.
54 Which of the following is used for comments in C++ ?
A.
/* comment */
B.
// comment */
C.
// comment
D.
both // comment or /* comment */
Answer
both // comment or /* comment */
Q.
55 Which of the following is not a type of Constructor in C++ ?
A.
Default constructor
B.
Friend constructor
C.
Parameterized constructor
D.
Copy constructor
Answer
Friend constructor
Q.
56 Which of the following type is provided by C++ but not C ?
A.
double
B.
float
C.
bool
D.
int
Answer
bool
Q.
57 Which of the following correctly declares an array in C++ ?
A.
array{10};
B.
int array[10];
C.
array array[10];
D.
int array;
Answer
int array[10];
Q.
58 What is Inheritance in C++ ?
A.
Deriving new classes from existing classes
B.
Overloading of classes
C.
Classes with same names
D.
Wrapping of data into a single class
Answer
Deriving new classes from existing classes
Q.
59 What is meant by a polymorphism in C++ ?
A.
class having only single form
B.
class having many forms
C.
class having four forms
D.
class having two forms
Answer
class having many forms
Q.
60 What is abstract class in C++ ?
A.
Any Class in C++ is an abstract class
B.
Class from which any class is derived
C.
Class specifically used as a base class with atleast one pure virtual functions
D.
Class specifically used as a base class with atleast one virtual functions
Answer
Class specifically used as a base class with atleast one pure virtual functions
Q.
61 Which of the following constructors are provided by the C++ compiler if not defined in a class ?
A.
Copy constructor
B.
Assignment constructor
C.
Default constructor
D.
All of the mentioned
Answer
Default constructor
Q.
62 The operator used for dereferencing or indirection is ____
A.
*
B.
&
C.
->
D.
->>
Answer
*
Q.
63 What will happen in the following C++ code snippet ?1. int a = 100, b = 200;2. int *p = &a, *q = &b;3. p = q;
A.
b is assigned to a
B.
p now points to b
C.
a is assigned to b
D.
q now points to a
Answer
p now points to b
Q.
64 Which operator is used to signify the namespace ?
A.
conditional operator
B.
ternary operator
C.
scope-resolution operator
D.
bitwise operator
Answer
scope-resolution operator
Q.
65 What does a class in C++ holds ?
A.
data
B.
functions
C.
both data & functions
D.
arrays
Answer
both data & functions
Q.
66 Which other keywords are also used to declare the class?
A.
class
B.
union
C.
object
D.
struct
Answer
class
Q.
67 The data members and functions of a class in C++ are by default ____________
A.
protected
B.
private
C.
public
D.
public & protected
Answer
private
Q.
68 Constructors are used to ____________
A.
initialize the objects
B.
delete the objects
C.
construct the data members
D.
both initialize the objects & construct the data members
Answer
initialize the objects
Q.
69 Which of these following members are not accessed by using direct member access operator ?
A.
public
B.
private
C.
protected
D.
both private & protected
Answer
both private & protected
Q.
70 How many objects can present in a single class ?
A.
1
B.
2
C.
3
D.
as many as possible
Answer
as many as possible
Q.
71 Which special character is used to mark the end of class ?
A.
;
B.
:
C.
#
D.
$
Answer
;
Q.
72 Which of the following operators can't be overloaded ?
A.
::
B.
-
C.
+
D.
[]
Answer
::
Q.
73 Which keyword is used to represent a friend function ?
A.
friend
B.
Friend
C.
friend_func
D.
Friend_func
Answer
friend
Q.
74 What is a friend function in C++ ?
A.
A function which can access all the private, protected and public members of a class
B.
A function which is not allowed to access any member of any class
C.
A function which is allowed to access public and protected members of a class
D.
A function which is allowed to access only public members of a class
Answer
A function which can access all the private, protected and public members of a class
Q.
75 What is a function template ?
A.
creating a function without having to specify the exact type
B.
creating a function with having an exact type
C.
creating a function without class
D.
creating a function without having blank spaces
Answer
creating a function without having to specify the exact type
Q.
76 What is the syntax of class template ?
A.
template <paramaters> class declaration
B.
Template <paramaters> class declaration
C.
temp <paramaters> class declaration
D.
Temp <paramaters> class declaration
Answer
template <paramaters> class declaration
Q.
77 What is meant by multiple inheritance ?
A.
Deriving a base class from derived class
B.
Deriving a derived class from base class
C.
Deriving a derived class from more than one base class
D.
Deriving a derived base class
Answer
Deriving a derived class from more than one base class
Q.
78 What is the type of inheritance in the following C++ code ?1. #include <iostream>2. using namespace std;3. class student4. {5. public:6. int rno , m1 , m2 ;7. };8. class sports9. {10. public:11. int sm;12. };13. class statement : public student, public sports14. {15. int tot,avg;16. };17. int main()18. {19. statement obj; 20. }
A.
Single inheritance
B.
Multilevel inheritance
C.
Multiple inheritance
D.
None
Answer
Multiple inheritance
Q.
79 Which of the following is the correct syntax to print the message in C++ language ?
A.
cout <<"Hello world!";
B.
Cout << Hello world! ;
C.
Out <<"Hello world!;
D.
None of the above
Answer
cout <<"Hello world!";
Q.
80 Which of the following is the address operator ?
A.
@
B.
#
C.
&
D.
%
Answer
&
Q.
81 For inserting a new line in C++ program, which one of the following statements can be used ?
A.
\n
B.
\r
C.
\a
D.
None of the above
Answer
\n
Q.
82 Which of the following refers to characteristics of an array ?
A.
An array is a set of similar data items
B.
An array is a set of distinct data items
C.
An array can hold different types of datatypes
D.
None of the above
Answer
An array is a set of similar data items
Q.
83 If we stored five elements or data items in an array, what will be the index address or the index number of the array's last data item ?
A.
3
B.
4
C.
5
D.
88
Answer
4
Q.
84 Wrapping data and its related functionality into a single entity is known as _____________
A.
Abstraction
B.
Encapsulation
C.
Polymorphism
D.
Modularity
Answer
Encapsulation
Q.
85 How many types of polymorphism are there in C++ ?
A.
1
B.
2
C.
3
D.
4
Answer
2
Q.
86 Which of the following is not a type of inheritance ?
A.
Multiple
B.
Distributive
C.
Multilevel
D.
Hierarchical
Answer
Distributive
Q.
87 Which of the following is called insertion operator ?
A.
<<
B.
>>
C.
>
D.
<
Answer
<<
Q.
88 Which of the following is called extraction operator ?
A.
<<
B.
>>
C.
>
D.
<
Answer
>>
Q.
89 What is the size of a boolean variable in C++ ?
A.
1 bit
B.
1 byte
C.
4 bytes
D.
2 bytes
Answer
1 bit
Q.
90 Which of the following is C++ equivalent for scanf() ?
A.
cin
B.
cout
C.
print
D.
input
Answer
cin
Q.
91 Which of the following is the scope resolution operator ?
A.
.
B.
*
C.
::
D.
~
Answer
::
Q.
92 What is std in C++ ?
A.
std is a standard class in C++
B.
std is a standard namespace in C++
C.
std is a standard file reading header in C++
D.
std is a standard file reading header in C++
Answer
std is a standard namespace in C++
Q.
93 Which of the following accesses the seventh element stored in array ?
A.
array[6];
B.
array[7];
C.
array[7];
D.
array;
Answer
array[6];
Q.
94 What will be the output of the following C++ code ?1. #include <iostream>2. using namespace std;3. int main()4. {5. int a = 21;6. int c ;7. c = a++;8. cout << c;9. return 0;10. }
A.
21
B.
22
C.
23
D.
20
Answer
21
Q.
95 What will be the output of the following C++ code ?1. #include <iostream>2. using namespace std;3. int main()4. {5. int num1 = 5;6. int num2 = 3;7. int num3;8. num3 = ++num29. cout < num310. return 0;11. }
A.
3
B.
4
C.
6
D.
5
Answer
4
Q.
96 What is the type of inheritance in the following C++ code ?1. #include <iostream>2. using namespace std;3. class A4. {5. float d;6. };7. 8. class B: public A9. {10. int a = 15;11. };12. 13. int main()14. {15. B b;16. return 0;17. }
A.
Single inheritance
B.
Multilevel inheritance
C.
None
D.
Friend inheritance
Answer
Single inheritance
Q.
97 What do vectors represent ?
A.
Static arrays
B.
Dynamic arrays
C.
Stack
D.
Queue
Answer
Dynamic arrays
Q.
98 Where does the execution of c++ program starts ?
A.
user-defined() function
B.
main() function
C.
void() function
D.
else() function
Answer
main() function
Q.
99 Which of the following correctly declares an array ?
A.
int array[10];
B.
int array;
C.
array{10};
D.
array array[10];
Answer
int array[10];
Q.
100 Which data type is used to represent the absence of parameters ?
A.
int
B.
void
C.
short
D.
float
Answer
void
Q.
101 The value 132.54 can be represented using which data type ?
A.
float
B.
void
C.
int
D.
bool
Answer
float
Q.
102 What is syntax of defining a constructor of class A ?
A.
a()
B.
~A()
C.
A()
D.
~A();
Answer
A()
Q.
103 Which function is used to open a file in C?
A.
open()
B.
fopen()
C.
file_open()
D.
fileopen()
Answer
fopen()
Q.
104 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;
Answer
FILE *file_pointer;
Q.
105 Header files ___.
A.
Contain function declarations
B.
Can be included to a program
C.
End with .h extension
D.
All of these
Answer
All of these
Q.
106 The sqrt() function is used to calculate which value?
A.
Square
B.
Square of reverse bits
C.
Square root
D.
None of these
Answer
Square root
Q.
107 A recursive function in C ___.
A.
Call itself again and again
B.
Loop over a parameter
C.
Return multiple values
D.
None of these
Answer
Call itself again and again
Q.
108 A ___ can be assigned the address of any data type.
A.
Dangling pointer
B.
Wild pointer
C.
Void pointer
D.
Null pointer
Answer
Void pointer
Q.
109 What will be the output of the following C code?
#include
int main(){
int x = 10, *ptr;
ptr = &x;
*ptr = 20;
printf("%d", x);
}
A.
10
B.
20
C.
Error
D.
A garbage value
Answer
20
Q.
110 Before using a pointer variable, it should be ___.
A.
Declared
B.
Initialized
C.
Both A. and B.
D.
None of the above
Answer
Both A. and B.
Q.
111 Which of the following is the collection of different data types?
A.
structure
B.
string
C.
array
D.
All of the above
Answer
structure
Q.
112 The size of a union is ___.
A.
Sum of sizes of all members
B.
Predefined by the compiler
C.
Equal to size of largest data type
D.
None of these
Answer
Equal to size of largest data type
Q.
113 Which feature of OOPS described the reusability of code?
A.
Abstraction
B.
Encapsulation
C.
Polymorphism
D.
Inheritance
Answer
Inheritance
Q.
114 A single program of OOPS contains _______ classes?
A.
Only 1
B.
Only 999
C.
Only 100
D.
Any number
Answer
Any number
Q.
115 Which operator from the following can be used to illustrate the feature of polymorphism?
A.
Overloading <<
B.
Overloading &&
C.
Overloading | |
D.
Overloading +=
Answer
Overloading <<
Q.
116 Which header file is required by the C++ programming language to use the OOPS concept?
A.
stdio.h
B.
iostream.h
C.
stdlib.h
D.
We can easily use the OOPS concepts in c++ programs without using any header file
Answer
We can easily use the OOPS concepts in c++ programs without using any header file
Q.
117 Which function best describe the concept of polymorphism in programming languages?
A.
Class member function
B.
Virtual function
C.
Inline function
D.
Undefined function
Answer
Virtual function
Q.
118 Which of the following feature is also known as run-time binding or late binding?
A.
Dynamic typing
B.
Dynamic loading
C.
Dynamic binding
D.
Data hiding
Answer
Dynamic binding
Q.
119 What is the output of this program?
#include
using namespace std;
int main()
{
int x = 3, k;
while (x-- >= 0) {
printf("%d ", x);
}
return 0;
}
A.
3 2 1 0
B.
2 1 0 -1
C.
infinite loop
D.
-65535
Answer
2 1 0 -1
Q.
120 What is the output of this program?
#include
using namespace std;
int main()
{
int x = -10;
while (x++ != 0)
printf("%d ", x);
return 0;
}
A.
0
B.
-1
C.
1
D.
infinite
Answer
1