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. Wed Sep 23 20:38:16 IST 2009:Sender:*** time out a
View Tutorial          By: charan at 2009-09-23 09:13:22

2. Hi all,
I'm getting this error on running

View Tutorial          By: shreya.g at 2008-06-23 00:13:52

3. I need
text,number,text,number,text,num

View Tutorial          By: kabil dev at 2015-05-29 13:10:40

4. There is 3rd Party webservices hosted over HTTPS,
View Tutorial          By: Ankur at 2012-02-24 16:49:59

5. Thanks for the useful tutorials abt strtus 1 vs St
View Tutorial          By: Sudharsan at 2011-12-03 11:54:58

6. Nice article. Really helpful in understanding the
View Tutorial          By: Sundar at 2011-12-18 11:15:07

7. Thanks this article helped (just needed to know wh
View Tutorial          By: sushi at 2008-12-17 08:09:51

8. really nice explanation
View Tutorial          By: kuldeep at 2012-08-23 13:04:30

9. I have tried that but still getting the same error
View Tutorial          By: pra at 2008-04-14 21:55:44

10. Unable to understand all the points, quiet confusi
View Tutorial          By: KB at 2015-04-15 10:11:14