i need help



 DEVELOP > c-Plus-Plus > i need help

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 21 Oct 2006 10:36:19 PM
Object: i need help
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.
.

User: "Jim Langston"

Title: Re: i need help 22 Oct 2006 12:28:05 AM
<h168210@gmail.com> wrote in message
news:1161488179.822058.52430@h48g2000cwc.googlegroups.com...

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Few ways to do it, depending on how you want to go. Simple way is put them
into a sorted contain, and then get the largest and the smallest.
Another way, put them in some type of container (array, vector, etc..) and
use a for loop going through each one comparing if it's smaller or greater
than saved values.
Sounds like a homework question, so I'm not going to give you any code.
.

User: "Mike Wahler"

Title: Re: i need help 22 Oct 2006 11:22:38 AM
<h168210@gmail.com> wrote in message
news:1161488179.822058.52430@h48g2000cwc.googlegroups.com...

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

int main()
{
int i[] = {1, 2, 3, 4, 5}; /* five integers */
i[0] == i[4]; /* compare smallest with largest */
return 0;
}
-Mike
.
User: "Eric"

Title: Re: i need help 22 Oct 2006 04:23:46 PM
Mike Wahler wrote:

<h168210@gmail.com> wrote in message
news:1161488179.822058.52430@h48g2000cwc.googlegroups.com...

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.


int main()
{
int i[] = {1, 2, 3, 4, 5}; /* five integers */
i[0] == i[4]; /* compare smallest with largest */
return 0;
}

-Mike


I bet you could have worked "between" in somehow.
.


User: "Salt_Peter"

Title: Re: i need help 22 Oct 2006 03:26:27 AM
wrote:

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Forget the smallest and the largest of 5 integers.
How do you declare an integer variable and initialize it?
How do you then compare 2 variables?
Show the code.
.

User: ""

Title: Re: i need help 22 Oct 2006 08:37:54 AM
wrote:

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

The smallest will always be smaller than the largest, unless all five
integers are equal, in which case the smallest is equal to the largest.
Easy! :-)
.

User: "Daniel T."

Title: Re: i need help 22 Oct 2006 12:21:37 AM
wrote:

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

http://www.sgi.com/tech/stl/max_element.html
http://www.sgi.com/tech/stl/min_element.html
--
There are two things that simply cannot be doubted, logic and perception.
Doubt those, and you no longer have anyone to discuss your doubts with,
nor any ability to discuss them.
.

User: "David Harmon"

Title: Re: i need help 21 Oct 2006 11:13:02 PM
On 21 Oct 2006 20:36:19 -0700 in comp.lang.c++,

wrote,

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Show the code that you have written. Describe how the result
differs from what you wanted. Ask specific questions.
This issue is covered in Marshall Cline's C++ FAQ. See the topic
"[5.2] How do I get other people to do my homework problem for me?"
It is always good to check the FAQ before posting. You can get the
FAQ at:
http://www.parashift.com/c++-faq-lite/
See the welcome message posted twice per week in comp.lang.c++ under
the subject "Welcome to comp.lang.c++! Read this first." or
available at http://www.slack.net/~shiva/welcome.txt
.

User: "Phlip"

Title: Re: i need help 21 Oct 2006 10:43:34 PM
h168210 wrote:

hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Sit down with your tutorial and read it, from the front cover, until you are
well past the answer. Do not return to a computer until you do this.
(Especially to post!;)
--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER