midtermsp01

# midtermsp01 - EGN 3210 Midterm NAME Spring 2001 SS 1 Write...

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

EGN 3210 Midterm Spring 2001 NAME_____________________________ SS#_____________________________ 1. Write a small program to input two numbers from the keyboard, max and incr and count from 0 to max in increments of incr . For example, if the user enters 10 and 3 then the output will be 0, 3, 6, 9. Use a for loop. 2. Write a function to compute n n k n k + + + + + + = = ) 1 ( 4 3 2 1 1 L . The input to the function is the integer n and the output is the sum. For example if the input is 5 then the output will be 15. Do no t use 2 ) 1 ( 1 + = = n n k n k . Use a for loop.

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

View Full Document
3. Write a segment of code to ask the user for 3 numbers in numerical order. Receive the numbers in variables a, b, c. If the numbers do not have this order a < b < c then repeat the process by asking the user to enter the numbers again. Repeat until a < b < c.
4. For each of the following code segments indicate what is the output. Assume all variables are declared.

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.

## This note was uploaded on 05/11/2008 for the course EGN 3210 taught by Professor Fernando during the Fall '05 term at University of Central Florida.

### Page1 / 4

midtermsp01 - EGN 3210 Midterm NAME Spring 2001 SS 1 Write...

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

View Full Document
Ask a homework question - tutors are online