just do interger division
if (number%2 %26gt; 0)
{
odd = odd + number;
}
else
{
even = even + number;
}
what % does is give you a remainder when doing interger division, the number has to be of type int. so if the number divides evenly by 2 then the remainder is 0. so we know it's even, if you divide 3 by two the % will equal 1, so we know the number is odd, etc... hmm might not work for 1, so make if read:
if (number%2 %26gt; 0 || number == 1)
so cut and paste this into a compiler:
#include %26lt;iostream%26gt;
int main()
{
using namespace std;
int number, even(0), odd(0);
do
{
cout %26lt;%26lt; "Please enter a number %26lt;Enter 0 to end input%26gt;: ";
cin %26gt;%26gt; number;
if (number%2 %26gt; 0 || number ==1)
odd = odd + number;
else
even = even + number;
}while (number != 0);
cout %26lt;%26lt; "The sum of the odd numbers entered is " %26lt;%26lt; odd %26lt;%26lt; endl;
cout %26lt;%26lt; "The sum of the even numbers entered is " %26lt;%26lt; even %26lt;%26lt; endl;
system("pause");
return 0;
}
that was kinda of fun, enjoy (won't work for negative, you can do that part). you call always change this to read from a file as well, the rest is up to you, i already gave you too much.
How to write a program in C++ that reads a set of integers and finds and prints the sum of the even and odd #.
Doing your homework, eh?
Tuesday, July 14, 2009
Beethoven - - symphony No. 5 in c minor OP.67 set 254?
There's no question. So there's no answer.
Beethoven - - symphony No. 5 in c minor OP.67 set 254?
Symphony No. 9 (Scherzo) by Beethoven is better
Reply:It's also known as "The Fate" symphony or the "Victory" symphony.
Reply:May I know what is your question(s) so I can help?
strawberry
Beethoven - - symphony No. 5 in c minor OP.67 set 254?
Symphony No. 9 (Scherzo) by Beethoven is better
Reply:It's also known as "The Fate" symphony or the "Victory" symphony.
Reply:May I know what is your question(s) so I can help?
strawberry
The mail from my website is not being delivered to my yahoo a/c? Do I need to set up a POP3 a/c?
My wesite is www.single-encounter.co.uk and posting from susanna@single-encounter.co.uk to susannarb@yahoo.co.uk Is there a block you end, or do I need to set something up?
Many thanks, Susanna
The mail from my website is not being delivered to my yahoo a/c? Do I need to set up a POP3 a/c?
You probably have to check the forwarding email address again in the email option of yahoo, see if the spelling ok to start with.
Many thanks, Susanna
The mail from my website is not being delivered to my yahoo a/c? Do I need to set up a POP3 a/c?
You probably have to check the forwarding email address again in the email option of yahoo, see if the spelling ok to start with.
Where is The O.c. flimed? Like what set? The name of the place or the address.?
Due to labor union salary rules about filming outside of Los Angeles County, the show is actually filmed at Raleigh Studios in Manhattan Beach (40 miles away from the actual Newport Beach) to reduce filming costs
Where is The O.c. flimed? Like what set? The name of the place or the address.?
in newport beach i remember.
Where is The O.c. flimed? Like what set? The name of the place or the address.?
in newport beach i remember.
Can a 501(c)(3) organization be set up to spay or neuter animals in a shelter?
Yes, I'm involved with an organization like that. They are 501(c)(3) and they adopt out stray animals, but pay to have them spayed and neutered first.
Hope that's what you're talking about, and good luck with it!
Can a 501(c)(3) organization be set up to spay or neuter animals in a shelter?
"More organizations use us to apply for tax exempt status than anyone else. Whether you are forming a charity, foundation, church, school, or even an animal rescue, we make it simple for you to get there."
In a word, yes.
Hope that's what you're talking about, and good luck with it!
Can a 501(c)(3) organization be set up to spay or neuter animals in a shelter?
"More organizations use us to apply for tax exempt status than anyone else. Whether you are forming a charity, foundation, church, school, or even an animal rescue, we make it simple for you to get there."
In a word, yes.
Strictly C D. Gutted. I set my video and it hasn`t taped.?
I`ve searched for a repeat and i can`t find one. Anyone else know if there is?
(Don`t bother with a smart a*se answer if you don`t like the show, just move on to the next question please)
Strictly C D. Gutted. I set my video and it hasn`t taped.?
i no it wont be hte same but if you go to www.bbc.co.uk/strictlycomedancing
and click on vidoe you can watch the dances from every saturday. it doenst tell u wat they scored but watch the show tonight for tht.
hope this helps
Reply:it has really bugged me this year that there is no repeat. the bbc has ****** up big time. so many people miss the odd show and i reckon they would get quite good viewing figures. i don't mean to rub it in but it was a really good show, maybe even the best one of the series. matt and flavia got the first perfect 40. although i think alisha deserved one for her dances. they were all outstanding tonight and really upped their games. they do show clips of the dances in the results show so you will see little bits. also try and catch it takes two week nights on bbc2 they also show clips from the saturday night show.
p.s alisha to win! although after tonights performances none of them deserve to go home, i would hate to be a judge, i don't know how they are going to choose.!!
Reply:there isnt one this year. last year it was on again on sunday but not this year. sorry but youve missed out. results sunday nite tho
Reply:No!! Sorry but this happened to me a couple of weeks ago and the show is not repeated like it was last year on BBC3.
I'm sure you'll watch the results and hopefully not feel you've missed out too much.
kudzu
(Don`t bother with a smart a*se answer if you don`t like the show, just move on to the next question please)
Strictly C D. Gutted. I set my video and it hasn`t taped.?
i no it wont be hte same but if you go to www.bbc.co.uk/strictlycomedancing
and click on vidoe you can watch the dances from every saturday. it doenst tell u wat they scored but watch the show tonight for tht.
hope this helps
Reply:it has really bugged me this year that there is no repeat. the bbc has ****** up big time. so many people miss the odd show and i reckon they would get quite good viewing figures. i don't mean to rub it in but it was a really good show, maybe even the best one of the series. matt and flavia got the first perfect 40. although i think alisha deserved one for her dances. they were all outstanding tonight and really upped their games. they do show clips of the dances in the results show so you will see little bits. also try and catch it takes two week nights on bbc2 they also show clips from the saturday night show.
p.s alisha to win! although after tonights performances none of them deserve to go home, i would hate to be a judge, i don't know how they are going to choose.!!
Reply:there isnt one this year. last year it was on again on sunday but not this year. sorry but youve missed out. results sunday nite tho
Reply:No!! Sorry but this happened to me a couple of weeks ago and the show is not repeated like it was last year on BBC3.
I'm sure you'll watch the results and hopefully not feel you've missed out too much.
kudzu
In c# programming,,,how to set an integer into a textbox?? need help please...?
I think you follow your textbox further help you search
http://webdesignehelp.in/
In c# programming,,,how to set an integer into a textbox?? need help please...?
if you have an int type you can do this:
int value=4;
textBox.Text=new Integer(4).ToString();
or if you already have an Integer type just type
textBox.Text=IntNumber.ToString();
Reply:I think you can use casting for examlpe
int a=10;
string b= (String) a;
Reply:myTextBox.Text = myInteger.ToString();
http://webdesignehelp.in/
In c# programming,,,how to set an integer into a textbox?? need help please...?
if you have an int type you can do this:
int value=4;
textBox.Text=new Integer(4).ToString();
or if you already have an Integer type just type
textBox.Text=IntNumber.ToString();
Reply:I think you can use casting for examlpe
int a=10;
string b= (String) a;
Reply:myTextBox.Text = myInteger.ToString();
Subscribe to:
Posts (Atom)