{"id":163,"date":"2020-04-03T09:23:01","date_gmt":"2020-04-03T09:23:01","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=163"},"modified":"2020-04-03T09:23:01","modified_gmt":"2020-04-03T09:23:01","slug":"c-mcq-6","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=163","title":{"rendered":"C++ MCQ -6"},"content":{"rendered":"<p>Question 1<\/p>\n<p> In an assignment statement<\/p>\n<p> a=b;<\/p>\n<p> Which of the following statement is true?<\/p>\n<p> a.\u00a0\u00a0\u00a0 The variable a and the variable b are equal.<\/p>\n<p> b.\u00a0\u00a0\u00a0 The value of b is assigned to variable a but the later changes on variable b will not effect the value of variable a<\/p>\n<p> c.\u00a0\u00a0\u00a0 The value of b is assigned to variable a and the later changes on variable b will effect the value of variable a<\/p>\n<p> d.\u00a0\u00a0\u00a0 The value of variable a is assigned to variable b and the value of variable b is assigned to variable a.<\/p>\n<p> \u00a0<br \/> Question 2<\/p>\n<p> All of the following are valid expressions in C++<\/p>\n<p> a\u00a0 =\u00a0 2 + (b = 5);<\/p>\n<p> a\u00a0 = b = c = 5;<\/p>\n<p> a\u00a0 = 11 % 3<\/p>\n<p> a.\u00a0\u00a0\u00a0 True<\/p>\n<p> b.\u00a0\u00a0\u00a0 False<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 3:<\/p>\n<p> To increase the value of c by one which of the following statement is wrong?<\/p>\n<p> a.\u00a0\u00a0\u00a0 c++;<\/p>\n<p> b.\u00a0\u00a0\u00a0 c = c + 1;<\/p>\n<p> c.\u00a0\u00a0\u00a0 c + 1 =&gt; c;<\/p>\n<p> d.\u00a0\u00a0\u00a0 c += 1<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 4:<\/p>\n<p> When following piece of code is executed, what happens?<\/p>\n<p> b = 3;<\/p>\n<p> a = b++;<\/p>\n<p> a.\u00a0\u00a0\u00a0 a contains 3 and b contains 4<\/p>\n<p> b.\u00a0\u00a0\u00a0 a contains 4 and b contains 4<\/p>\n<p> c.\u00a0\u00a0\u00a0 a contains 4 and b contains 3<\/p>\n<p> d.\u00a0\u00a0\u00a0 a contains 3 and b contains 3<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 5:<\/p>\n<p> The result of a Relational operation is always<\/p>\n<p> a.\u00a0\u00a0\u00a0 either True or False<\/p>\n<p> b.\u00a0\u00a0\u00a0 is less than or is more than<\/p>\n<p> c.\u00a0\u00a0\u00a0 is equal or less or more<\/p>\n<p> d.\u00a0\u00a0\u00a0 All of these<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 6:<\/p>\n<p> Which of the following is not a valid relational operator?<\/p>\n<p> a.\u00a0\u00a0\u00a0 ==<\/p>\n<p> b.\u00a0\u00a0\u00a0 =&gt;<\/p>\n<p> c.\u00a0\u00a0\u00a0 &gt;=<\/p>\n<p> d.\u00a0\u00a0\u00a0 &gt;=<\/p>\n<p> \u00a0<br \/> Question 7:<\/p>\n<p> What is the final value of x when the code int x; for(x=0; x&lt;10; x++) {} is run?<\/p>\n<p> A. 10<\/p>\n<p> B. 9<\/p>\n<p> C. 0<\/p>\n<p> D. 1<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 8:<\/p>\n<p> When does the code block following while(x&lt;100) execute?<\/p>\n<p> A. When x is less than one hundred<\/p>\n<p> B. When x is greater than one hundred<\/p>\n<p> C. When x is equal to one hundred<\/p>\n<p> D. While it wishes<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 9:<\/p>\n<p> Which is not a loop structure?<\/p>\n<p> A. for<\/p>\n<p> B. do while<\/p>\n<p> C. while<\/p>\n<p> D. repeat until<\/p>\n<p> \u00a0<\/p>\n<p> \u00a0<br \/> Question 10:<\/p>\n<p> How many times is a do while loop guaranteed to loop?<\/p>\n<p> A. 0<\/p>\n<p> B. Infinitely<\/p>\n<p> C. 1<\/p>\n<p> D. Variable<\/p>\n<p> Answers<\/p>\n<p> \u00a0<\/p>\n<p> 1.\u00a0\u00a0\u00a0 b. The value of b is assigned to variable a but the later changes on variable b will not effect the value of variable a<\/p>\n<p> 2.\u00a0\u00a0\u00a0 a. True<\/p>\n<p> 3.\u00a0\u00a0\u00a0 c. c + 1 =&gt; c;<\/p>\n<p> 4.\u00a0\u00a0\u00a0 a. a contains 3 and b contains 4<\/p>\n<p> 5.\u00a0\u00a0\u00a0 a. either True or False<\/p>\n<p> 6.\u00a0\u00a0\u00a0 b. =&gt;<\/p>\n<p> 7.\u00a0\u00a0\u00a0 A. 10<\/p>\n<p> 8.\u00a0\u00a0\u00a0 A. When x is less than one hundred<\/p>\n<p> 9.\u00a0\u00a0\u00a0 D. Repeat Until<\/p>\n<p> 10.\u00a0\u00a0\u00a0 C. 1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question 1 In an assignment statement a=b; Which of the following statement is true? a.\u00a0\u00a0\u00a0 The variable a and the variable b are equal. b.\u00a0\u00a0\u00a0 The value of b is assigned to variable a but the later changes on variable b will not effect the value of variable a c.\u00a0\u00a0\u00a0 The value of b is&#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-163","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\/163","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=163"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}