{"id":227,"date":"2020-04-05T08:49:55","date_gmt":"2020-04-05T08:49:55","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=227"},"modified":"2020-04-05T08:49:55","modified_gmt":"2020-04-05T08:49:55","slug":"computer-science-mcq-1","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=227","title":{"rendered":"Computer Science MCQ-1"},"content":{"rendered":"<p><strong>Q.1 Literal means<\/strong><br \/> (A) a string. (B) a string constant.<br \/> (C) a character. (D) an alphabet.<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.2 Choose the correct answer<\/strong><br \/> (A) Casting refers to implicit type conversion.<br \/> (B) Coercion refers to implicit type conversion.<br \/> (C) Casting means coercion.<br \/> (D) Coercion refers to explicit type conversion.<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.3 printf (\u0393\u00c7\u00a3%d\u0393\u00c7\u00a5, printf (\u0393\u00c7\u00a3tim\u0393\u00c7\u00a5));<\/strong><br \/> (A) results in a syntax error (B) outputs tim3<br \/> (C) outputs garbage (D) outputs tim and terminates abruptly<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <em>printf statement will print tim3, \u0393\u00c7\u00a3tim\u0393\u00c7\u00a5 due to inner printf statement and 3 as length due to<br \/> outer printf statement.<\/em><\/p>\n<p> <strong>Q.4 Output of the following program fragment is<br \/> x = 5;<br \/> y = x++;<br \/> printf(\u0393\u00c7\u00a3%d%d\u0393\u00c7\u00a5, x, y);<\/strong><br \/> (A) 5, 6 (B) 5, 5<br \/> (C) 6, 5 (D) 6, 6<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <em>x is incremented by 1 and before that increment the value is assigned to y so value of x=6 and<br \/> y=5.<\/em><\/p>\n<p> <strong>Q.5 The value of an automatic variable that is declared but not initialised will be<\/strong><br \/> (A) 0 (B) -1<br \/> (C) unpredictable (D) none of these<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <strong>Q.6 Consider the following program<br \/> main ( )<br \/> { float a = 0.5, b = 0.7;<br \/> if (b &lt; 0.8)<br \/> if (a &lt; 0.5) printf (\u0393\u00c7\u00a3ABCD\u0393\u00c7\u00a5);<br \/> else printf (\u0393\u00c7\u00a3PQR\u0393\u00c7\u00a5);<br \/> else printf (\u0393\u00c7\u00a3JKLF);<br \/> }<br \/> The output is<\/strong><br \/> (A) ABCD (B) PQR<br \/> (C) JKLF (D) None of these<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <em>Since b=0.7&lt;0.8, the control goes to second \u0393\u00c7\u00a3if\u0393\u00c7\u00a5 statement where (a&lt;0.5) is false to printf<br \/> statement in else part executed printing \u0393\u00c7\u00a3PQR\u0393\u00c7\u00a5<\/em><\/p>\n<p> <strong>Q.7 The following program fragment<br \/> int *a;<br \/> *a = 7;<\/strong><br \/> (A) assigns 7 to a (B) results in compilation error<br \/> (C) assigns address of a as 7 (D) segmentation fault<br \/> <strong>Ans:D<\/strong><\/p>\n<p> <strong>Q.8 A pointer variable can be<\/strong><br \/> (A) passed to a function as argument.<br \/> (B) changed within function.<br \/> (C) returned by a function.<br \/> (D) assigned an integer value.<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <strong>Q.9 \u0393\u00c7\u00ffC\u0393\u00c7\u00d6 is often called a<\/strong><br \/> (A) Object oriented language (B) High level language<br \/> (C) Assembly language (D) Machine level language<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.10 The loop in which the statements within the loop are executed at least once is called<\/strong><br \/> (A) do-while (B) while<br \/> (C) for (D) goto<br \/> <strong>Ans:A<\/strong><\/p>\n<p> <strong>Q.11 The control automatically passes to the first statement after the loop in<\/strong><br \/> (A) continue statement (B) break statement<br \/> (C) switch statement (D) if statement<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.12 A self contained block of statements that perform a coherent task of some kind is called a<\/strong><br \/> (A) Monitor (B) Function<br \/> (C) Program (D) Structure<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.13 Recursion is sometimes called<\/strong><br \/> (A) Circular definition (B) Complex definition<br \/> (C) Procedure (D) Union<br \/> <strong>Ans:A<\/strong><\/p>\n<p> <strong>Q.14 Unsigned integer occupies<\/strong><br \/> (A) Two bytes (B) Four bytes<br \/> (C) One byte (D) Eight bytes<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.15 Each C preprocessor directive begins with<\/strong><br \/> (A) # (B) include<br \/> (C) main() (D) {<br \/> <strong>Ans:A<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q.1 Literal means (A) a string. (B) a string constant. (C) a character. (D) an alphabet. Ans:B Q.2 Choose the correct answer (A) Casting refers to implicit type conversion. (B) Coercion refers to implicit type conversion. (C) Casting means coercion. (D) Coercion refers to explicit type conversion. Ans:B Q.3 printf (\u0393\u00c7\u00a3%d\u0393\u00c7\u00a5, printf (\u0393\u00c7\u00a3tim\u0393\u00c7\u00a5)); (A) results&#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":[22],"tags":[],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-computer-science-combined"],"_links":{"self":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/227","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=227"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}