MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors in C++ Programming
→
How many types of specialization are there in c++?..
1.
How many types of specialization are there in c++?
A.
4
B.
3
C.
2
D.
1
E.
None of these
Answer» D. 1
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> template<typename type><br> class Test<br> {<br> public:<br> virtual type Function(type num1)<br> {<br> return num1 * 2;<br> }<br> };<br> int main()<br> {<br> Test<int> num1;<br> cout << num1.Function(150) << endl;<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> template <class type><br> class Sample<br> {<br> public:<br> Sample()<br> {<br> };<br> ~Sample()<br> { <br> };<br> type FunA(type num1)<br> {<br> return num1;<br> }<br> type FunB(type num2)<br> {<br> return num2;<br> }<br> };<br> int main()<br> {<br> Sample<int> num1;<br> Sample<double> num2;<br> cout << num1.FunA(250) << " ";<br> cout << num2.FunB(5.225);<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> template <typename T = float, int count = 3><br> T Multiply(T num1)<br> {<br> for(int kk = 0; kk < count; kk++)<br> {<br> num1 = num1 * num1;<br> }<br> return num1;<br> };<br> int main()<br> {<br> float num2 = 1.25;<br> cout << num2 << " " << Multiply<>(num2) << endl;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> template <class T><br> inline T square(T n1)<br> {<br> T Output;<br> Output = n1 * n1;<br> return Output;<br> };<br> template <><br> string square<string>(string Str)<br> {<br> return (Str + Str);<br> };<br> int main()<br> {<br> int k = 4, kk;<br> string bb("B");<br> kk = square<int>(k);<br> cout << k << ": " << kk;<br> cout << square<string>(bb) << ":" << endl;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> template<class T = float, int k = 5> class N<br> {<br> public:<br> N();<br> int value;<br> };<br> template<> class N<> <br> { <br> public: N(); <br> };<br> template<> class N<double, 10><br> { <br> public: N(); <br> };<br> template<class T, int k> N<T, k>::N() : value(k)<br> {<br> cout << value;<br> }<br> N<>::N() <br> {<br> cout << " Out of ";<br> }<br> N<double, 10>::N() <br> {<br> cout << "10" << endl;<br> }<br> int main() <br> {<br> N<int, 8> x;<br> N<> y;<br> N<double, 10> z;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <string><br> #include <cstring><br> using namespace std;<br> template <class type><br> type Maximum(const type value1, const type value2)<br> {<br> cout << "No Specialization";<br> return value1 < value2 ? value2 : value1;<br> }<br> template <><br> const char *Maximum(const char *value1, const char *value2)<br> {<br> return (strcmp(value1, value2) < 0) ? value2 : value1;<br> }<br> int main()<br> {<br> string S1 = "class", S2 = "template";<br> const char *value3 = "Interveiw";<br> const char *value4 = "Mania";<br> const char *q = Maximum(value3, value4);<br> cout << q << endl;<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> template<typename type><br> type Maximum(type num1, type num2)<br> {<br> return num1 > num2 ? num1:num2;<br> }<br> int main()<br> {<br> int Res;<br> Res = Maximum(150, 250);<br> cout << Res << endl;<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 classA <br> {<br> public:<br> virtual ~classA(){}<br> protected:<br> char p;<br> public:<br> char getChar();<br> };<br> class classB : public classA <br> {<br> public:<br> void printChar();<br> };<br> void classB::printChar()<br> {<br> cout << "False" << endl;<br> }<br> int main() <br> {<br> classB ch;<br> ch.printChar();<br> return 1;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> template <class T><br> inline T square(T p)<br> {<br> T result;<br> result = p * p;<br> return result;<br> };<br> template <><br> string square<string>(string str)<br> {<br> return (str+str);<br> };<br> int main() <br> {<br> int k = 4, kk;<br> string bb("A");<br> kk = square<int>(k);<br> cout << k << kk;<br> cout << square<string>(bb) << endl;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> class BaseClass<br> {<br> public:<br> BaseClass( )<br> {<br> cout << "I ";<br> }<br> ~BaseClass ( )<br> {<br> cout << " Mania";<br> }<br> };<br> class DerivedClass : public BaseClass<br> {<br> public:<br> DerivedClass ( )<br> {<br> cout << "Love ";<br> }<br> ~DerivedClass ( )<br> {<br> cout << "Interview";<br> } <br> }; <br> int main( )<br> {<br> DerivedClass x;<br> }<br></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply