Comment on Tutorial - Using switch Statements in C++ By Emiley J



Comment Added by : basil

Comment Added at : 2011-08-04 13:00:30

Comment on Tutorial : Using switch Statements in C++ By Emiley J
3. Write a program that will continuously ask for an integer input from the user until a negative
value is entered. Display the sum and the average of the numbers entered (not including the
negative sentinel value). (Filename: Filename: Exer6.cpp)
Example output:
Please enter number 1? 10
Please enter number 2? 8
Please enter number 3? 3
Please enter number 3? -1
Average is 7.
Computer for sum and average again [Y/N]? N
Goodbye.


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. When I tried to run this code, I got time out ***
View Tutorial          By: Gandhi at 2009-06-04 06:20:48

2. Hi,
I'm having a problem with the above cod

View Tutorial          By: sushanth at 2015-05-04 07:32:17

3. Simple and straightforward. Thats what I like abou
View Tutorial          By: Barand at 2009-03-21 11:03:47

4. plz answr for questions about time out problem whl
View Tutorial          By: rrai at 2013-08-26 06:06:57

5. Thanks.It helps a lot to me.
View Tutorial          By: Sachin at 2013-05-24 19:36:36

6. nice examlpe but u can make it more easy so that t
View Tutorial          By: lovely at 2009-02-25 07:08:18

7. Nice one.your example proves that if you are apply
View Tutorial          By: Nisarg pathak at 2015-09-30 17:23:37

8. pls send more tutorial on my id
View Tutorial          By: vipin at 2012-11-17 07:23:49

9. Thank you
View Tutorial          By: Angeline at 2011-06-28 06:27:12

10. to Donovan Aces #61, thank you, I am new to java &
View Tutorial          By: Joe at 2011-09-14 22:40:19