CSE202Lab4

CSE202Lab4 - numbers. For example, if a user enters 45 and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 202 Lab Assignment 4 NOTE: No need to submit anything electronically. Write the following short program and turn in the hard copy. If your programs ever get stuck in an infinite loop, press control + C to kill the program. Before beginning, from the terminal, create a new directory called lab4, and change your working directory to lab4. Instructions: 1. Write a program that prompts a user for two numbers and then computes and outputs the sum of all of the consecutive numbers between the two
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: numbers. For example, if a user enters 45 and 51, your program will compute (45 + 46 + 47 + 48 + 49 + 50 + 51) then output the result to the screen. You may have to check whether the first number is less or greater than the second number and accordingly compute the values. Please answer the following questions and submit it along with a print-out of your code: a) Which type of Repetitive Structure did you use? Why? b) Which type of Selection Structure did you use? Why?...
View Full Document

Ask a homework question - tutors are online