MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors in C++ Programming
→
What is the return type of the conversion operator..
1.
What is the return type of the conversion operator?
A.
no return type
B.
float
C.
int
D.
void
E.
None of these
Answer» B. float
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int main()<br> {<br> int p;<br> p = 15 + 13 * 6;<br> cout << p;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int main()<br> {<br> int p = 7, q = 9, r;<br> r = (p > q) ? p : q;<br> cout << r;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int main ()<br> {<br> int p, q;<br> p = 6;<br> q = ++p * ++p;<br> cout << p< p = 6;<br> q = p++ * ++p;<br> cout < return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> class Example <br> {<br> public:<br> int m, n;<br> Example() {};<br> Example(int, int);<br> Example operator + (Example);<br> };<br> Example::Example (int p, int q) <br> {<br> m = p;<br> n = q;<br> }<br> Example Example::operator+ (Example parameter) <br> {<br> Example container;<br> container.m = m + parameter.m;<br> container.n = n + parameter.n;<br> return (container);<br> }<br> int main () <br> {<br> Example p (3,4);<br> Example q (6,5);<br> Example R;<br> R = p + q;<br> cout << R.m << "," << R.n;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> void Add(int p, int q, int & r)<br> {<br> p = q + r;<br> p = q + r;<br> r = p + q;<br> }<br> int main()<br> {<br> int n = 6, m =4;<br> Add(n, m, m);<br> cout << n << " " << m;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> ostream & operator< {<br> return k;<br> }<br> int main()<br> {<br> cout << 10 << endl;<br> cin.get();<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <string><br> using namespace std;<br> class Example<br> {<br> public:<br> operator string () <br> { <br> return "Converted...";<br> }<br> };<br> int main()<br> {<br> Example examp;<br> string str = examp;<br> cout << str << endl;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <cmath><br> using namespace std;<br> class ComplexNumber<br> {<br> private:<br> double RealNumber;<br> double ImagNumber;<br> public:<br> ComplexNumber(double r = 0.0, double i = 0.0) : RealNumber(r), ImagNumber(i)<br> {}<br> double mag()<br> { <br> return getMag();<br> }<br> operator double ()<br> {<br> return getMag();<br> }<br> private:<br> double getMag()<br> {<br> return sqrt(RealNumber * RealNumber + ImagNumber * ImagNumber);<br> }<br> };<br> int main()<br> {<br> ComplexNumber comp(2.0, 5.0);<br> cout << comp.mag()< cout << comp;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> class Example<br> {<br> public:<br> Example(int k) : num_k(k) { }<br> public:<br> int operator()(int k = 0) const <br> { <br> return num_k + k; <br> }<br> operator int () const <br> { <br> return num_k; <br> }<br> private:<br> int num_k;<br> friend int g(const Example&);<br> };<br> int fun(char Z)<br> {<br> return Z;<br> }<br> int main()<br> {<br> Example fun(6);<br> cout << fun(5);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> main()<br> {<br> double num = 23.9399;<br> float num0 = 20.23;<br> int p ,q;<br> p = (int) num;<br> q = (int) num0;<br> cout << p < return 0;<br> }<br></iostream></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply