Partial preview of the text
Download CSD 101 MIDSEMS 2017 and more Exercises Programming Languages in PDF only on Docsity!
(iii (i) (ii) (iii) (iv) 1 W) Pew A Rwy ————=S mS Aeolian Bard) @ SH Nagar UNIVERSITY Programme: B. Tech Discipline: Computer Science and Engineering Exam: Mid Semester Year: 2017-2018 Course Code: CSD101 Course Title: Introduction to Computing & Programming Date: September 26, 2017 Time: 9:30 AM - 11:00 AM Max. Marks: 50 Ques.1 Fill in the following blanks : (1*8 = 8 Marks) Variable which exists and retains its value even after the control is transferred to the calling function belongs to ___ storage class. . The standard mathematical functions are included in the header file. An immediate exit from the loop can be achieved by a TT statement. The function int func(); takes (how many?) arguments. oo storage class can be used to declare global variable known to all the functions in the ile. A 7 is a graphical representation of an algorithm. Keyword is used in a function prototype to indicate that a function does not return a value or to indicate that a function contains no parameters. data type will throw an error on % (modulus) operator. Ques.2 Convert the following numbers from one base to another. (The intermediate steps must be (1*5 =5 Marks) shown), is (1100001)2 = to decimal (100100.1010)2 = to octal (98765)io = ( )s (BABA) i«= to binary (1110110)2-(1010111)2 Perform Binary Subtraction Ques.3 Write TRUE or FALSE against each of the following statements: (1*5 = 5 Marks) In switch statement, the default case is optional. C keywords can be used as variable names. The continue statement cannot be used with switch statement. ‘If statement represents the evaluated result in the form of either non-zero or zero values. In a while loop, if the body is executed ‘n* times, then the test expression is executed (n+1) times. Ques.4 Find the error in each of the following program segments and explain how the error can be corrected: (1*5 = 5 Marks) (a) int g( void ) printf( "Inside function g\n" ): int h( void ) { printf( "Inside function h\n" ); } Scanned by CamScanner