By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

C++ program that prompts the user to enter three different positive iteger values

P: 2
Write a program that prompts the user to enter three different integer values.If the values are not different, the program prints a message"equal values" and terminates(hint: use the return statement).If either of the values is negative,the progra prints"Negative input" and terminates.Otherwie, it prints the values that the user enters.
After that, the program compares the first integer and the second ineger and prints either "The first integer is larger than the second" or "The second integer is lager than the first".Then it compares the second integer and the third integer and prints either "The second integer is larger than the third" or "The third integer is larger than the second".
On seperate lines, the program should print the minium value, the maximum value,total of the input values,their average and their product.Make sure you know what happens wen input data exceed the legal range for integers.Make sure that these results are correct even when the input values are close to the legal limits for integers(hint: convert input values to the values of type double).Fr example, if the user enters 1000000, 2000000, 3000000, the dialog looks this way:
Please enter three different psitive integer values:1000000,2000000,3000000
The second integer is larger than the first
The third integer is larger than the second
The minimum value is 1000000
The maximum value is 3000000
The average value is 2e+006
The product is 6e+018

Defne variables that contains the results of computations as close to their use as possible,no at the start of main(). Test the program so that each statement of te program was executed at least once.
Oct 3 '07 #1
Share this Question
Share on Google+
3 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Where are you stuck on this? What have you tried?
Oct 3 '07 #2

P: 1
Where are you stuck on this? What have you tried?
im stuck on the body
Oct 23 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.
Oct 23 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.