# sheet3 - Helwan University Faculty of Computers and...

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

Helwan University Faculty of Computers and Information First year CS112 – Programming Language I Academic year (2009/2010) Sheet #3 Functions and Arrays Collaboration You may ask your friends for help understanding certain concepts. Your friends can help you only by illustrating those concepts. You may not copy someone else's work or ask someone to write solutions for you explicitly. Cheating or plagiarism will be punished severely . How to submit the answers Log in with your account to http://fci.helwan.edu.eg/moodle . Open the “Programming -1” page. Click on each assignment named Sheet 3.x. Click the “Browse” button at the bottom of the page. Choose the file containing your solution that ends with a “.c” extension. Follow the instruction accurately. Late submissions Late submissions will not be accepted at all. This sheet will be graded and added to your total grade. If you face any problems, please contact [email protected] . Due date is Sunday May 6 th 2010. 1. Find the error in each of the following program segments, and explain how the error can be corrected a) int g( void ) { printf( "Inside function g\n" ); int h( void ) { printf( "Inside function h\n" ); } } b) int sum( int x, int y ) { int result; result = x + y;

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

View Full Document
} c) int sum( int n ) { if ( n == 0 ) return 0 ; else n + sum( n - 1 ); } d) void f ( double a); { float a; printf(“%f”, a ); } e) void product( void ) { int a; int b; int c; int result; printf( "Enter three integers: " ); scanf(“%f%f%f”, a , b . c); result = a * b * c; printf( "Result is %f" , result); return result; } f) #include <stdio.h> ; g) arraySize = 10 ;
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/06/2011 for the course CS 112 taught by Professor Halaabdulgalil during the Spring '10 term at Helwan University, Helwan.

### Page1 / 4

sheet3 - Helwan University Faculty of Computers and...

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

View Full Document
Ask a homework question - tutors are online