{"id":169,"date":"2020-04-03T09:25:36","date_gmt":"2020-04-03T09:25:36","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=169"},"modified":"2020-04-03T09:25:36","modified_gmt":"2020-04-03T09:25:36","slug":"c-mcq-12","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=169","title":{"rendered":"C++ MCQ-12"},"content":{"rendered":"<p><strong>Q.1\u00a0\u00a0 The address of a variable temp of type float is\u00a0\u00a0\u00a0<\/strong> \u00a0<br \/> \u00a0\u00a0\u00a0 (A) *temp\u00a0 (B) &amp;temp<br \/> \u00a0\u00a0\u00a0 (C) float&amp; temp\u00a0 (D) float temp&amp;<br \/> \u00a0<br \/> <strong>\u00a0 Ans: B<\/strong><br \/> \u00a0<br \/> <strong>Q.2\u00a0\u00a0 What is the output of the following code \u00a0<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 char symbol[3]={\u0393\u00c7\u00ffa\u0393\u00c7\u00d6,\u0393\u00c7\u00ffb\u0393\u00c7\u00d6,\u0393\u00c7\u00ffc\u0393\u00c7\u00d6};\u00a0 \u00a0<br \/> \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 for (int index=0; index&lt;3; index++)<br \/> \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 cout &lt;&lt; symbol [index];\u00a0<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (A) a b c\u00a0 (B) \u0393\u00c7\u00a3abc\u0393\u00c7\u00a5<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (C) abc\u00a0 (D) \u0393\u00c7\u00ffabc\u0393\u00c7\u00d6<br \/> \u00a0 \u00a0<br \/> <strong>\u00a0 Ans: C<\/strong><br \/> \u00a0<br \/> <strong>Q.3\u00a0\u00a0 The process of building new classes from existing one is called ______.<\/strong><br \/> (A)\u00a0 Polymorphism\u00a0 (B) Structure<br \/> (C)\u00a0 Inheritance\u00a0 (D) Cascading<br \/> \u00a0<br \/> <strong>\u00a0 Ans: C<br \/> \u00a0<br \/> Q.4\u00a0\u00a0 If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access\u00a0\u00a0\u00a0<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<br \/> (A)\u00a0\u00a0 protected and public data only in C and B. \u00a0<br \/> (B)\u00a0\u00a0 protected and public data only in C. \u00a0<br \/> (C)\u00a0\u00a0 private data in A and B. \u00a0<br \/> (D)\u00a0\u00a0 protected data in A and B.<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans: D<br \/> \u00a0<br \/> Q.5\u00a0\u00a0 If the variable count exceeds 100, a single statement that prints \u0393\u00c7\u00a3Too many\u0393\u00c7\u00a5 is\u00a0\u00a0 \u00a0<\/strong><br \/> (A)\u00a0 if (count&lt;100) cout &lt;&lt; \u0393\u00c7\u00a3Too many\u0393\u00c7\u00a5;\u00a0 \u00a0<br \/> (B)\u00a0 if (count&gt;100) cout &gt;&gt; \u0393\u00c7\u00a3Too many\u0393\u00c7\u00a5;\u00a0 \u00a0<br \/> (C)\u00a0 if (count&gt;100) cout &lt;&lt; \u0393\u00c7\u00a3Too many\u0393\u00c7\u00a5;\u00a0 \u00a0<br \/> (D)\u00a0 None of these.<\/p>\n<p> <strong>Ans: C<br \/> \u00a0<br \/> Q.6\u00a0\u00a0 Usually a pure virtual function<\/strong><br \/> (A)\u00a0 has complete function body.<br \/> (B)\u00a0 will never be called.<br \/> (C)\u00a0 will be called only to delete an object.<br \/> (D)\u00a0 is defined only in derived class.<br \/> <strong>\u00a0<br \/> \u00a0\u00a0 Ans: D<br \/> \u00a0<br \/> Q.7\u00a0\u00a0 To perform stream I\/O with disk files in C++, you should<\/strong><br \/> (A)\u00a0\u00a0 open and close files as in procedural languages. \u00a0<br \/> (B)\u00a0 use classes derived from ios.<br \/> (C)\u00a0\u00a0 use C language library functions to read and write data. \u00a0<br \/> (D)\u00a0\u00a0 include the IOSTREAM.H header file.<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans: B<br \/> \u00a0<br \/> Q.8\u00a0\u00a0 Overloading the function operator\u00a0<\/strong>\u00a0 \u00a0<br \/> (A)\u00a0\u00a0 requires a class with an overloaded operator.<br \/> (B)\u00a0\u00a0 requires a class with an overloaded [ ] operator. \u00a0<br \/> (C)\u00a0\u00a0 allows you to create objects that act syntactically like functions.<br \/> (D)\u00a0\u00a0 usually make use of a constructor that takes arguments.<br \/> \u00a0<br \/> <strong>\u00a0 Ans: A<br \/> \u00a0<br \/> Q.9\u00a0\u00a0 In C++, the range of signed integer type variable is ________\u00a0<\/strong> \u00a0<br \/> \u00a0\u00a0\u00a0\u00a0 ^=raised to<br \/> \u00a0\u00a0 \u00a0 (A) 0 to 2^16\u00a0\u00a0 (B)\u00a0 -2^15\u00a0\u00a0\u00a0 to 2^15<br \/> \u00a0\u00a0\u00a0\u00a0 (C) -2^7\u00a0\u00a0 to 2&amp;7 (D) 0 to 2^8<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans: B<br \/> \u00a0<br \/> Q.10\u00a0\u00a0 If\u00a0 2 y,5 x = =\u00a0 then\u00a0 y x ?\u00a0 equals________.<\/strong><br \/> \u00a0\u00a0\u00a0\u00a0\u00a0 (where\u00a0 ?\u00a0 is a bitwise XOR operator)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (A) 00000111\u00a0 (B) 10000010<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (C) 10100000\u00a0 (D) 11001000<br \/> \u00a0 \u00a0<br \/> <strong>\u00a0 Ans: A<br \/> \u00a0<br \/> Q.11\u00a0\u00a0 If an array is declared as int a[4] = {3, 0, 1, 2}, then values assigned to a[0] &amp; a[4] will be ________<\/strong><br \/> (A)\u00a0 3, 2\u00a0 (B) 0, 2<br \/> (C)\u00a0 3, 0\u00a0 (D) 0, 4 \u00a0<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans: C<br \/> \u00a0 \u00a0<br \/> Q.12\u00a0\u00a0 Mechanism of deriving a class from another derived class is known as____\u00a0<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<br \/> (A) Polymorphism\u00a0 (B)\u00a0 Single Inheritance<br \/> (C) Multilevel Inheritance\u00a0 (D)\u00a0 Message Passing<br \/> \u00a0\u00a0\u00a0 \u00a0<br \/> <strong>\u00a0\u00a0 Ans: C<br \/> \u00a0<br \/> Q.13\u00a0 RunTime Polymorphism is achieved by ______\u00a0<\/strong>\u00a0 \u00a0<br \/> (A)\u00a0 friend function\u00a0 (B)\u00a0 virtual function<br \/> (C)\u00a0 operator overloading\u00a0 (D)\u00a0 function overloading<br \/> <strong>\u00a0<br \/> \u00a0 Ans: B<br \/> \u00a0<br \/> Q.14\u00a0\u00a0 A function call mechanism that passes arguments to a function by passing a copy of the values<\/strong><br \/> of the arguments is __________<br \/> (A)\u00a0 call by name\u00a0 (B)\u00a0 call by value<br \/> (C)\u00a0 call by reference\u00a0 (D)\u00a0 call by value result<br \/> \u00a0<br \/> <strong>\u00a0 Ans: B<br \/> \u00a0<br \/> Q.15\u00a0\u00a0 In C++, dynamic memory allocation is accomplished with the operator ____<\/strong><br \/> (A) new\u00a0 (B)\u00a0 this<br \/> (C) malloc( )\u00a0 (D)\u00a0 delete<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans: A<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q.1\u00a0\u00a0 The address of a variable temp of type float is\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0\u00a0 (A) *temp\u00a0 (B) &amp;temp \u00a0\u00a0\u00a0 (C) float&amp; temp\u00a0 (D) float temp&amp; \u00a0 \u00a0 Ans: B \u00a0 Q.2\u00a0\u00a0 What is the output of the following code \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 char symbol[3]={\u0393\u00c7\u00ffa\u0393\u00c7\u00d6,\u0393\u00c7\u00ffb\u0393\u00c7\u00d6,\u0393\u00c7\u00ffc\u0393\u00c7\u00d6};\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 for (int index=0; index&lt;3; index++) \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 cout &lt;&lt; symbol&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-169","post","type-post","status-publish","format-standard","hentry","category-c-and-c-programming-language"],"_links":{"self":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}