{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# TA C162 - BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE PILANI...

This preview shows pages 1–2. Sign up to view the full content.

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, PILANI – 333031 Second Semester 2004-2005 TA C162 Computer Programming-I Comprehensive Examination (CLOSED BOOK) 30% (90 Marks) May 09, 2005 (08-11 AM) ID.No. _____________________ Instructions: [1] The question paper contains two parts, namely Part A and Part B , with maximum marks 50 and 40 respectively. Each part has to be answered in separate answer-sheet. Part A has to be completed within first 75 minutes . You can attempt Part B after submission (immediately after 75 minutes or earlier) of Part A. [2] Avoid overwriting. [3] Calculators are not allowed. Part A MM=50 Time= 75 Mins. For each question select the most appropriate choice among the four choices given and put a tick ( ) mark corresponding to the selected choice in the given answer-sheet. Each correct answer fetches 2 marks . There is no negative marking for Part A. What will be the output of the following C programs or program segments given in question to 1 to 9? Assume that required header and library files are included. Q1. main() { int x,y;x=y=0; while(y<10) ++y; x+=y; printf("x=%d,y=%d",x,y); } A. x=10,y=10 B. x=10,y=9 C. x=9,y=10 D. x=11, y=11 Q2. main() { int a[10]; i=10; for(i=0;i<5;i++) a[i]=0; for(i=0;i<=5;i++) a[i]=i++; for(i=0;i<=5;i++) printf("%d ",a[i]); } A. 1 2 3 4 5 6 B. 0 0 2 0 4 0 C. 1 0 2 0 3 4 D. 0 0 0 0 0 0 Q3. main() {void change(int); int a=4; change(a); printf("%d",a); } void change(int a) { printf("%d" ,++a); } Q4. main() { int i=6720,j=4; while((i%j)==0) { i=i/j;j=j+1;} printf("%d",j); }

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern