Professional Documents
Culture Documents
What Do You Mean by Void' Return Type?
What Do You Mean by Void' Return Type?
+ addition
– subtraction
* multiplication
/ division
% module
Answer: All functions should return a value as per the general syntax.
However, in case, if we don't want a function to return any value, we use “void” to indicate
that. This means that we use “void” to indicate that the function has no return value or it
returns “void”.
Example:
1 void myfunc()
2{
3 Cout<<”Hello,This is my function!!”;
4}
5 int main()
6{
7 myfunc();
8 return 0;
9}
Answer: Objects in an array are destructed in the reverse order of construction: First
constructed, last destructed.
Q5: What is a function?
Ans: A function is a block of code which executes the statements when we call it.
It consists of three entities:
1) the function name.this is simply a unique identifier.
2) The function parameters.this is a set of zero or more typed identifier.
3) The function return type this specifies the type of value function returns.
Explicit: the conversion of data type of two operands is not automatic but forced.we can force
an expression to be a specific type by using a cast.
Q9: What is inheritance in C++ and name the different types of inheritance?
Ans: it is a technique of organizing information in a hierarchy form. It is like a child
inheriting the features of its parent.
The class which we are inheriting from is called as the base class and the class which inherits
called as derived class.
Ans . C++ is called object oriented programming (OOP) language because C++
language views a problem in terms of objects involved rather than the procedure
for doing it.