midterm soruları - ATILIM UNIVERSITY...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ATILIM UNIVERSITY Department of Computer Engineering COMPE 112 Computer Programming in C Instructor: Fügen Selbes Midterm 2 Date: May 5, 2003 Duration: 110 min. Q1(15pts.) What is the output of the following programs? #include <stdio.h> int a=5; void xyz(int a,int *b) { *b=a+*b/3; a=4; printf("%3d%3d\n",a,*b); } void main(void) { int b=9; printf("%3d%3d\n",a,b); int a=12; xyz(b,&a); printf("%3d%3d\n",a,b); } 5 9 4 1 3 1 3 9 #include <stdio.h> int xyz(int a,int *b) { printf("%3d%3d\n",a,*b); *b=a-*b; printf("%3d%3d\n",a,*b); return(2*a); } void main(void) { int x=8,y=15; printf("%3d",xyz(x,&y)); printf("%3d\n",y); } 8 1 5 8 - 7 1 6 - 7 1/5 Name Surname Id Signature Q1(15pts) Q2(30pts) Q3(30pts) Q4(30pts) Total
Background image of page 1

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

View Full DocumentRight Arrow Icon
Q2.(30 pts.) You are expected to write 3 different functions that will receive two integers and will determine whether the integers are equal to each other or not. a. If the two integers are equal to each other, the function value returned is ‘y’; otherwise it is ‘n’. char equal(int a, int b)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/03/2009 for the course INDUSTRIAL IE 307 taught by Professor Arzuakyüz during the Spring '09 term at Atılım Üniversitesi.

Page1 / 5

midterm soruları - ATILIM UNIVERSITY...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online