My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Programming

Programming Programming Languages, Interpreters, and Compilers - Assembly, Declarative, Machine, Object Oriented, Iterative

LinkBack Thread Tools Display Modes
November 1st, 2009, 08:27 AM   #1
Joined: Nov 2009
Posts: 1
Program to find sum of 3 integers...

Could someone help me with this please.

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"
INPUT "Please enter an integer."
INPUT "Please enter another different integer."
INPUT "Please enter another different integer."

set sum to zero

IF (N1>N2 & N1>N3)


ELSE IF(N2>N3 & N2>N1)



IF(N1<N2 & N1<N3)


ELSE IF(N2<N3 & N2<N1)



difference = largest - smallest
sum = N1 + N2 + N3
product = N1*N2*N3
average = sum/3
BrainByMattel is offline  

My Computer Forum is free to register and we welcome everyone!


  My Computer Forum > Computer Science Forum > Programming

find, integers, program, sum

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find interval with the smallest variance in sequence keram Algorithms 0 March 10th, 2014 01:15 PM
Reinstalling an expired program Mathmonster Computer Science 0 July 20th, 2013 12:00 PM
What language(s) do you prefer to program in? Infinity Computer Science 36 March 16th, 2013 03:44 AM
Best Screencasting Program Nerazzurri_KZ Computer Science 3 July 11th, 2012 02:55 AM
C++ program code, need help with this C++ application. chetanbhasin Programming 0 June 17th, 2010 06:57 PM

Copyright © 2019 My Computer Forum Forum. All rights reserved.