q6 sol6 - CSCI.1100 Computer Science I Quiz 6 October 26,...

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

View Full Document Right Arrow Icon
CSCI.1100 Computer Science I Quiz 6 October 26, 2009 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login: Circle your lab section: (01 MTh 10:00) (02 MTh 12:00) (03 MTh 2:00) (04 MTh 4:00) (05 MTh 6:00) (06 MTh 10:00) (07 TF 10:00) (08 TF 12:00) (09 MTh 12:00) (10 TF 2:00) (11 MTh 4:00) You will have 15 minutes to complete this test. Make sure you do not spend too much time on any question. 1. Write a function to find and return the smallest integer in a list containing at least one item (5 points)? int smallest ( int list[], int size) { int smallest = list[0]; for ( int i = 0; i < size; i++) { if (smallest > list[i]) smallest = list[i]; } return smallest; } 1 point for function header 1 point for variable and initialization 1 point for for loop 1 point for conditional
Background image of page 1

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

View Full DocumentRight Arrow Icon
1 point for correct result 2. Write a function to find and return the longest string (most characters) in a list containing at least one string (5 points)? string longest(string list[],
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 04/04/2011 for the course CORE 101 taught by Professor Poop during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 3

q6 sol6 - CSCI.1100 Computer Science I Quiz 6 October 26,...

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