Write a program that will prompt the user for three integers. The program should then find the difference between the largest and smallest integers. The program should also calculate the sum of the three inegers and also their product and average. Display to the user difference, sum, product and average.
N.B The user should not be able to enter the same number more than once. Your program should be user friendly.
Print "Greetings"
Process_three_integers_of_different_values
INPUT "Please enter an integer."
N1
INPUT "Please enter another different integer."
N2
INPUT "Please enter another different integer."
N3
set sum to zero
IF (N1>N2 & N1>N3)
largest=N1;
ELSE IF(N2>N3 & N2>N1)
largest=N2;
ELSE
largest=N3;
IF(N1<N2 & N1<N3)
smallest=N1;
ELSE IF(N2<N3 & N2<N1)
smallest=N2;
ELSE
smallest=N3;
difference = largest - smallest
sum = N1 + N2 + N3
product = N1*N2*N3
average = sum/3
Edited by Lesser_Intellect, 01 November 2009 - 03:43 PM.


Sign In
Create Account


Back to top









