You are required to provide:-
(i) Algorithm (Flowchart or Pseudocode) and
(ii) Java program
for the following problem.
Write a program that reads positive integers, finds the smallest of them. Assume that the input ends with number -1. Suppose that you entered 3 5 2 5 5 5 -1; the program finds that the smallest is 2.
Here are sample runs of the program:
Sample 1: Enter numbers:
3
5
2
5
5
5
-1
The smallest number is 2.
Due Date : 10/4/2016
No comments:
Post a Comment