You are on page 1of 2
Birla Institate of Technology & Science, Pilani Work-Integrated Learning Programmes Division Second Semester 2014-2015 ‘Mid-Semester Fest (EC-2 Regular) Course No. :TAZC163 Course Title COMPUTER PROGRAMMING Nature of Exam : Closed Book Weightage 235% Date of Exam 120022015 (FN) Note: 1, Please follow all the Instructions to Candidates given on the cover page of the answer book. 2._Assumptions made if any, should be stated clearly atthe beginning of your answer. QL. Answer the following: (@)__Drawa flowchart to get sum of series given below: N Yen oea* = (b) Find out the decimal number whose IEEE 32 bit format representation is: 1119040010} 000} 10000000000000008 ¢ (©) Write the output of following program fragment: #include int main) { inti ae —— printi("%a" return 0; } (@ _—_ Whatis the output of following program fragment: finclude int maing { inti ks for(-0,-2, print } retum 0 } (©) Whatis output of following program fragment: #inelude int main { inti; switeh() ( case I: printf"Leaming C "); break; case 2: printf(“Comp Prog"); break; case 1*3+1: printf"Its fun!" break; } : return 0; , TA ZC163 (EC-2 Regular) ‘Second Semester 2014-2015 Page 1 of? SSS... a TA ZC163 (EC-2 Regular) Second Semester 2014-2015 Page 2 () ~ What will be the output of following for lop: for (x= 1; 5x44) printf ("%d ", x); B+2+2+2eH= 1 Q.2.@) Writ program to print fllowing output pattem upton Tins (read the values ofm ffm keyboard) using For Loops: 1 121 12421 12464 Q.2(b) _-A-65, B67. Use2's Complement Representation wherever required, (Assume you have & bit system) Calouiate @ AB (et) AB (5+38] Q3.(@) Write a single statement (ternary operator) to check whether year is leap year or not. (You can use logical operators also in this). 3 (b) Write program to print sum of cubes of al non prime numbers between 1 wo 500 without using power Function. [1+5=6) Q.4. Given marks of 10 students (Read from keyboard) in 5 subject each. Using Switeh-Case display How many Sindents(count) got "A" grade, “A-' grade, ‘B" grade, “B-’ grade, ‘C’ grade, “C-” grade, D grade in each subject separately where grades percentage are: (31 Grade Percentage A S=80 A SS and BO B >=65 and 15 B $560 and <65 ic 3=50 and <60 c 3=40 and <50 D [<0 Q.5. Given an integer number (Read from keyboard). Using Recursive Function write @ program to print Fibonacei series till given number. (31 TA ZCI63 (EC-2 Regular) ‘Second Semester 2014-2015 Page 2 of 2 cr

You might also like