{"id":168,"date":"2020-04-03T09:25:12","date_gmt":"2020-04-03T09:25:12","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=168"},"modified":"2020-04-03T09:25:12","modified_gmt":"2020-04-03T09:25:12","slug":"c-mcq-11","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=168","title":{"rendered":"C++ MCQ-11"},"content":{"rendered":"<p><strong>Q.31\u00a0 Use of virtual functions implies<\/strong><br \/> (A)\u00a0 overloading.\u00a0 (B)\u00a0 overriding.<br \/> (C)\u00a0 static binding.\u00a0 (D)\u00a0 dynamic binding.<br \/> <strong>Ans: D<br \/> \u00a0<br \/> Q.32\u00a0\u00a0 this pointer\u00a0\u00a0<\/strong>\u00a0 \u00a0<br \/> (A)\u00a0 implicitly points to an object.\u00a0 \u00a0<br \/> (B)\u00a0 can be explicitly used in a class.<br \/> (C)\u00a0 can be used to return an object. \u00a0<br \/> (D)\u00a0 All of the above.<br \/> <strong>\u00a0<br \/> \u00a0Ans: D<br \/> \u00a0<br \/> Q.33\u00a0\u00a0 Within a switch statement<\/strong><br \/> \u00a0\u00a0\u00a0 (A) Continue can be used but Break cannot be used \u00a0<br \/> \u00a0\u00a0\u00a0 (B) Continue cannot be used but Break can be used<br \/> \u00a0\u00a0\u00a0 (C) Both Continue and Break can be used\u00a0 \u00a0<br \/> \u00a0\u00a0\u00a0 (D) Neither Continue nor Break can be used<br \/> \u00a0<br \/> <strong>\u00a0 Ans:B<br \/> \u00a0<br \/> Q.34\u00a0\u00a0 Data members which are static<\/strong><br \/> \u00a0\u00a0\u00a0 (A) cannot be assigned a value<br \/> \u00a0\u00a0\u00a0 (B) can only be used in static functions<br \/> \u00a0\u00a0\u00a0 (C) cannot be defined in a Union \u00a0<br \/> \u00a0\u00a0\u00a0 (D) can be accessed outside the class<br \/> <strong>\u00a0\u00a0 \u00a0<br \/> \u00a0 Ans:B<br \/> \u00a0<br \/> Q.35\u00a0\u00a0 Which of the following is false for cin?\u00a0\u00a0<\/strong> \u00a0<br \/> (A)\u00a0 It represents standard input. \u00a0<br \/> (B)\u00a0 It is an object of istream class.<br \/> (C)\u00a0 It is a class of which stream is an object. \u00a0<br \/> (D)\u00a0 Using cin the data can be read from user\u0393\u00c7\u00d6s terminal.<br \/> <strong>\u00a0<br \/> \u00a0 Ans:C<br \/> \u00a0<br \/> Q.36\u00a0 It is possible to declare as a friend\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)\u00a0\u00a0 a member function\u00a0 (B)\u00a0 a global function<br \/> (C)\u00a0\u00a0 a class\u00a0 (D)\u00a0 all of the above<br \/> \u00a0\u00a0\u00a0 \u00a0<br \/> <strong>\u00a0 Ans:D<br \/> \u00a0<br \/> Q.37\u00a0 In multiple inheritance \u00a0<\/strong><br \/> (A)\u00a0 the base classes must have only default constructors\u00a0 \u00a0<br \/> (B)\u00a0 cannot have virtual functions<br \/> (C)\u00a0 can include virtual classes\u00a0 \u00a0<br \/> (D)\u00a0 None of the above.<br \/> \u00a0<br \/> <strong>\u00a0 Ans:C<\/strong><\/p>\n<p> <strong>Q.38 Declaration of a pointer reserves memory spac<\/strong>e \u00a0<br \/> (A)\u00a0 for the object.<br \/> (B)\u00a0 for the pointer.<br \/> (C)\u00a0 both for the object and the pointer.<br \/> (D)\u00a0 none of these.<br \/> \u00a0<br \/> <strong>\u00a0\u00a0 Ans:B<br \/> \u00a0<br \/> Q.39\u00a0 for (; \ud83d\ude09<\/strong><br \/> (A)\u00a0 means the test which is done using some expression is always true\u00a0 \u00a0<br \/> (B)\u00a0 is not valid<br \/> (C)\u00a0 will loop forever \u00a0<br \/> (D)\u00a0 should be written as for( )<br \/> \u00a0<br \/> <strong>\u00a0 Ans:C<br \/> \u00a0<br \/> Q.40\u00a0\u00a0 The operator &lt;&lt; when overloaded in a class<\/strong><br \/> (A)\u00a0 must be a member function\u00a0 (B)\u00a0 must be a non member function \u00a0<br \/> (C)\u00a0 can be both (A) &amp; (B) above\u00a0 (D)\u00a0 cannot be overloaded<br \/> \u00a0<br \/> <strong>\u00a0 Ans:C<br \/> \u00a0<br \/> Q.41\u00a0 A virtual class is the same as\u00a0\u00a0\u00a0<\/strong> \u00a0<br \/> (A)\u00a0 an abstract class\u00a0 (B)\u00a0 a class with a virtual function<br \/> (C)\u00a0 a base class\u00a0 (D)\u00a0 none of the above.<br \/> \u00a0<br \/> <strong>\u00a0 Ans:D<br \/> \u00a0<br \/> Q.42\u00a0\u00a0 Identify the operator that is NOT used with pointers <\/strong>\u00a0<br \/> \u00a0\u00a0\u00a0\u00a0 (A)\u00a0 -&gt;\u00a0 (B)\u00a0 &amp;<br \/> \u00a0\u00a0 \u00a0 (C)\u00a0\u00a0\u00a0 *\u00a0 (D)\u00a0 &gt;&gt;\u00a0<br \/> \u00a0<br \/> <strong>\u00a0 Ans:D<br \/> \u00a0<br \/> Q.43\u00a0\u00a0 Consider the following statements<\/strong><br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 char *ptr;<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ptr = \u0393\u00c7\u00a3hello\u0393\u00c7\u00a5;<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout &lt;&lt; *ptr;\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 What will be printed?\u00a0\u00a0\u00a0 \u00a0<br \/> (A)\u00a0 first letter\u00a0 (B)\u00a0 entire string \u00a0<br \/> (C)\u00a0 it is a syntax error\u00a0 (D)\u00a0 last letter\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<br \/> \u00a0 \u00a0<br \/> <strong>\u00a0\u00a0 Ans:A<br \/> \u00a0<br \/> Q.44\u00a0 In which case is it mandatory to provide a destructor in a class?<\/strong> \u00a0<br \/> (A)\u00a0 Almost in every class<br \/> (B)\u00a0 Class for which two or more than two objects will be created<br \/> (C) Class for which copy constructor is defined \u00a0<br \/> (D) Class whose objects will be created dynamically<br \/> \u00a0<br \/> <strong>\u00a0 Ans:D<br \/> \u00a0<br \/> Q.45\u00a0\u00a0 The members of a class, by default, are \u00a0<\/strong><br \/> \u00a0(A)\u00a0 public\u00a0 (B) protected<br \/> \u00a0(C)\u00a0 private\u00a0 (D)\u00a0 mandatory to specify \u00a0<br \/> \u00a0 \u00a0<br \/> <strong>\u00a0 Ans:C<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q.31\u00a0 Use of virtual functions implies (A)\u00a0 overloading.\u00a0 (B)\u00a0 overriding. (C)\u00a0 static binding.\u00a0 (D)\u00a0 dynamic binding. Ans: D \u00a0 Q.32\u00a0\u00a0 this pointer\u00a0\u00a0\u00a0 \u00a0 (A)\u00a0 implicitly points to an object.\u00a0 \u00a0 (B)\u00a0 can be explicitly used in a class. (C)\u00a0 can be used to return an object. \u00a0 (D)\u00a0 All of the above. \u00a0 \u00a0Ans: D&#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-168","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\/168","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=168"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}