MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors
→
How many types of models are available to create t..
1.
How many types of models are available to create the user-defined data type?
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> #include <string><br> using namespace std;<br> void PermutationString( string& orig, string& Permutation )<br> {<br> if (orig.empty())<br> {<br> cout << Permutation << endl;<br> return;<br> }<br> for (int k = 0; k < orig.size(); ++k)<br> {<br> string orig2 = orig;<br> orig2.erase(k, 1);<br> string Permutation2 = Permutation;<br> Permutation2 += orig.at(k);<br> PermutationString(orig2, Permutation2);<br> }<br> }<br> int main()<br> {<br> string orig = "Sumi";<br> string Permutation;<br> PermutationString(orig, Permutation);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"> #include <iostream><br> #include <vector><br> #include <algorithm><br> using namespace std;<br> void show(const vector<int>& Data)<br> {<br> for (size_t k = 0; k < Data.size(); ++k)<br> {<br> cout << Data[i] << ' ';<br> }<br> cout << endl;<br> }<br> int main()<br> {<br> vector<int> Data;<br> Data.push_back(2);<br> Data.push_back(6);<br> Data.push_back(6);<br> sort(Data.begin(), Data.end());<br> show(Data);<br> while(next_permutation(Data.begin(), Data.end()))<br> show(Data);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"> #include <iostream><br> #include <vector><br> #include <algorithm><br> using namespace std;<br> void Result(const vector<int>& VectorData)<br> {<br> for (size_t k = 0; k < VectorData.size(); ++k)<br> {<br> cout << VectorData[k] << ' ';<br> }<br> }<br> int main()<br> {<br> vector<int> VectorData;<br> VectorData.push_back(4);<br> VectorData.push_back(8);<br> sort(VectorData.begin(), VectorData.end());<br> Result(VectorData);<br> while(next_permutation(VectorData.begin(), VectorData.end()))<br> Result(VectorData);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <algorithm><br> using namespace std;<br> int main () <br> {<br> int Numbers[] = {23, 25, 32, 43};<br> sort (Numbers, Numbers + 4);<br> do <br> {<br> } while ( next_permutation(Numbers, Numbers + 4) );<br> cout << Numbers[0] << ' ' << Numbers[1] << ' ' << Numbers[2] << ' ' << Numbers[3] << ' n';<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"> #include <iostream><br> #include <algorithm><br> #include <vector><br> using namespace std;<br> bool myfunction (int p,int q) <br> {<br> return (p < q);<br> }<br> int main () <br> {<br> int var[] = {90, 80, 70, 60, 50};<br> vector<int> Num(var, var + 5);<br> partial_sort (Num.begin(), Num.begin() + 4, Num.end());<br> partial_sort (Num.begin(), Num.begin() + 4, Num.end(),<br> myfunction);<br> for (vector<int> :: iterator Iter = Num.begin(); Iter != Num.end(); ++Iter)<br> cout << ' ' << *Iter;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <algorithm><br> #include <vector><br> using namespace std;<br> bool Function(int k, int L)<br> { <br> return (k < L);<br> }<br> struct ObjectClass {<br> bool operator() (int k, int L)<br> {<br> return (k < L);<br> } <br> } StructObject;<br> int main () <br> {<br> int arr[] = {112, 125, 101};<br> vector<int> Number(arr, arr + 3);<br> sort (Number.begin(), Number.begin() + 2);<br> sort (Number.begin() + 1, Number.end(), Function);<br> sort (Number.begin(), Number.end(), StructObject);<br> for (vector<int> :: iterator Iter = Number.begin(); Iter != Number.end(); ++Iter)<br> cout << ' ' << *Iter;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"> #include <iostream><br> #include <iterator><br> #include <list><br> using namespace std;<br> int main () <br> {<br> list<int> DataList;<br> for (int i = 0; i < 10; i++) <br> DataList.push_back (i * 30);<br> list<int> :: iterator firstIter = DataList.begin();<br> list<int> :: iterator lastIter = DataList.end();<br> cout << distance(firstIter, lastIter) << endl;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <iterator><br> #include <list><br> using namespace std;<br> int main () <br> {<br> list<int> List1, List2;<br> for (int k = 0; k <= 3; k++)<br> { <br> List1.push_back(k); <br> List2.push_back(k * 12); <br> }<br> list<int> :: iterator Iter;<br> Iter = List1.begin(); <br> advance (Iter, 3);<br> copy (List2.begin(), List2.end(), inserter(List1, Iter));<br> for ( Iter = List1.begin(); Iter != List1.end(); ++Iter )<br> cout << *Iter << " ";<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <iterator><br> #include <list><br> using namespace std;<br> int main () <br> {<br> list<int> DataList;<br> for (int k = 0; k < 8; k++) <br> DataList.push_back (k * 8);<br> list<int> :: iterator Iter = DataList.begin();<br> advance (Iter, 6);<br> cout << *Iter << endl;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <vector><br> #include <iterator><br> using namespace std;<br> int main ()<br> {<br> vector<int> VectorData;<br> for (int k = 0; k <= 8; k++)<br> VectorData.push_back(k);<br> VectorData.erase (VectorData.begin() + 6);<br> VectorData.erase (VectorData.begin(), VectorData.begin() + 4);<br> for (unsigned k = 0; k < VectorData.size(); ++k)<br> {<br> cout << ' ' << VectorData[k];<br> }<br> return 0;<br> }<br></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply