473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

C++ - Program to Input and Sum Only Even Numbers

Here is what I am supposed to do...Write a C++ program that asks for 10 numbers and prints the sum of only the even numbers. I also have to use an if statement and a while loop. Please please please help, I feel dumb!!!
Aug 22 '08 #1
2 3760
boxfish
469 Expert 256MB
Hi,
Can you write a program that asks for ten numbers using a loop? That would be the first step toward writing this program.
Aug 22 '08 #2
sicarie
4,677 Expert Mod 4TB
colordrm88-

Welcome to bytes.com, please have a look at the rules of this forum. In accordance with those rules, I've changed your thread title to actually describe your problem, as we don't allow "help!" "hi" etc...

As boxfish asked - are you familiar with reading in data? Loop control? Summation and printing? Where are you getting stuck on this - what do you need help with?

sicarie
Aug 22 '08 #3

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

Similar topics

10
by: atlanta | last post by:
this is a simple C++ program to write. "Write a complete and functioning structured program that successfully compiles on Visual C++ 6, that uses two-dimensional array (5x5) that stores...
6
by: hoover_richard | last post by:
I am a newbie to C++ and I need help with a simple program I am trying to write. My program is designed to print all of the odd integers contained in an array and output the sum of the odd...
8
by: brian.digipimp | last post by:
I turned this in for my programming fundamentals class for our second exam. I am a c++ newb, this is my first class I've taken. I got a good grade on this project I'm just wondering if there is a...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
7
by: Hulo | last post by:
In a C program I am required to enter three numbers (integers) e.g. 256 7 5 on execution of the program. C:\> 256 7 5 There should be spaces between the three numbers and on pressing "enter",...
5
by: CoreyWhite | last post by:
It is possible to use martingale probability theory to beat some games of chance. In a fair game of coin toss, where the odds reach an equilibrium of 50/50 chain reactions do occur. This can be...
9
by: Hemal | last post by:
Hi All, I need to know the memory required by a c program. Is there any tool/utility which can give me the memory usage in terms of DATA segment, TEXT segment, BSS segment etc. I am working...
2
by: gdarian216 | last post by:
the object of the project was to create a program that inputs multiple lines of integers and outputs them in an HTML table. The negative numbers should be red. The numbers should be printed 3 in a...
1
by: altaey | last post by:
Question Details: Write a program to find and print a Fibonacci sequence of numbers. The Fibonacci sequence is defined as follow: Fn = Fn-2 + Fn-1, n >= 0 F0 = 0, F1 = 1, F2 = 1 Your...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.