{"id":231,"date":"2020-04-05T08:51:55","date_gmt":"2020-04-05T08:51:55","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=231"},"modified":"2020-04-05T08:51:55","modified_gmt":"2020-04-05T08:51:55","slug":"computer-science-mcq-4","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=231","title":{"rendered":"Computer Science MCQ-4"},"content":{"rendered":"<p><strong>Q.46 What would be output of the following program, if the array begins at 65486?<br \/> main()<br \/> {<br \/> int arr[ ] = {12, 14, 15, 23, 45};<br \/> printf(\u0393\u00c7\u00a3%u%u\u0393\u00c7\u00a5, arr+1, &amp;arr+1);<br \/> }<\/strong><br \/> (A) 65486, 65486 (B) 65488, 65488<br \/> (C) 65488, 65496 (D) None of the above<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <em>Array begins at address 65486 so arr+1=65488 as size of int is 2 bytes and<br \/> &amp;arr+1=65486+10=65496 as there are 5 elements in array.<\/em><\/p>\n<p> <strong>Q.47 Given the statement, maruti.engine.bolts=25;<br \/> which of the following is true?<\/strong><br \/> (A) Structure bolts is nested within structure engine<br \/> (B) Structure engine is nested within structure maruti<br \/> (C) Structure maruti is nested within structure engine<br \/> (D) Structure maruti nested within structure bolts<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.48 Which amongst the following is not a keyword?<\/strong><br \/> (A) external (B) int<br \/> (C) float (D) double<br \/> <strong>Ans:A<\/strong><\/p>\n<p> <strong>Q.49 If a = 5 and b = 7 then the statement p = (a &gt; b) : a ? b<\/strong><br \/> (A) assigns a value 5 to p (B) assigns a value 7 to p<br \/> (C) assigns a value 8 to p (D) gives an error message<br \/> <strong>Ans:D<\/strong><\/p>\n<p> <strong>Q.50 The expression P &gt;&gt; 6 shifts all bits of P six places to right. What is the value of P &gt;&gt; 6 if<br \/> P = 0\u251c\u00f9 6db7 ?<\/strong><br \/> (A) 0\u251c\u00f91234 (B) 0\u251c\u00f9 0001<br \/> (C) 0\u251c\u00f9 0000 (D) 0\u251c\u00f91B6<br \/> <strong>Ans:D<\/strong><\/p>\n<p> <strong>Q.51 If an integer occupies 4 bytes and a character occupies 1 bytes of memory, each element of the<br \/> following structure would occupy how many bytes?<br \/> struct name<br \/> {<br \/> int age;<br \/> char name [20];<br \/> }<\/strong><br \/> (A) 5 (B) 24<br \/> (C) 21 (D) 22<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.52 If an array is used as function argument, the array is passed<\/strong><br \/> (A) by value. (B) by reference<br \/> (C) by name. (D) the array cannot be used as a function argument.<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.53 To access a structure element using a pointer, ___________ operator is used<\/strong><br \/> (A) dot (.) (B) pointer (&amp;)<br \/> (C) pointer (*) (D) arrow (\u252c\u00ab)<br \/> <strong>Ans:D<\/strong><\/p>\n<p> <strong>Q.54 The library function sqrt( ) operates on a double precision argument. If, i is an integer<br \/> variable, which one of the following calls would correctly compute sqrt(i)?<\/strong><br \/> (A) sqrt((double)i) (B) (double) sqrt(i)<br \/> (C) (double) (sqrt(i)) (D) sqrt(i)<br \/> <strong>Ans:A<\/strong><\/p>\n<p> <strong>Q.55 What will happen if the following loop is executed?<br \/> int num = 0;<br \/> do<br \/> {<br \/> &#8211;num;<br \/> printf(\u0393\u00c7\u00a3%d\u0393\u00c7\u00a5, num);<br \/> num++;<br \/> }while (num &gt;= 0);<br \/> }<\/strong><br \/> (A) The loop will run infinite number of times.<br \/> (B) The program will not enter the loop.<br \/> (C) There will be a compilation error.<br \/> (D) There will be runtime error.<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <strong>Q.56 The break statement causes an exit<\/strong><br \/> (A) Only from the innermost loop.<br \/> (B) Only from the innermost switch.<br \/> (C) From the innermost loop or switch.<br \/> (D) From the program.<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <strong>Q.57 It is necessary to declare the type of function in the calling program if<\/strong><br \/> (A) Function returns an integer.<br \/> (B) Function returns a non-integer value.<br \/> (C) Function is not defined in the same file.<br \/> (D) Function is called number of times.<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.58 The function fprintf is used in a program<\/strong><br \/> (A) When too many printf calls have been already used in the program.<br \/> (B) In place of printf, since printf uses more memory.<br \/> (C) When the output is to be printed on to a file.<br \/> (D) When the type of variables to be printed are not known before.<br \/> <strong>Ans:C<\/strong><\/p>\n<p> <strong>Q.59 The following statement displays<br \/> float x = 2000.53;<br \/> printf (\u0393\u00c7\u00a3%e\u0393\u00c7\u00a5, x);<\/strong><br \/> (A) 2.00053e+04 (B) 2.00053e+03<br \/> (C) 2.00053+e04 (D) 2.0005e+03<br \/> <strong>Ans:B<\/strong><\/p>\n<p> <strong>Q.60 The output of the following is<br \/> int a = 75;<br \/> printf (\u0393\u00c7\u00a3%d%%\u0393\u00c7\u00a5, a);<\/strong><br \/> (A) 75 (B) 75%%<br \/> (C) 75% (D) None of the above<br \/> <strong>Ans:D<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q.46 What would be output of the following program, if the array begins at 65486? main() { int arr[ ] = {12, 14, 15, 23, 45}; printf(\u0393\u00c7\u00a3%u%u\u0393\u00c7\u00a5, arr+1, &amp;arr+1); } (A) 65486, 65486 (B) 65488, 65488 (C) 65488, 65496 (D) None of the above Ans:C Array begins at address 65486 so arr+1=65488 as size of&#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-231","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\/231","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=231"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}