Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > i need help

Reply
Thread Tools

i need help

 
 
h168210@gmail.com
Guest
Posts: n/a
 
      10-22-2006
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.

 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      10-22-2006
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!!!


 
Reply With Quote
 
 
 
 
David Harmon
Guest
Posts: n/a
 
      10-22-2006
On 21 Oct 2006 20:36:19 -0700 in comp.lang.c++, http://www.velocityreviews.com/forums/(E-Mail Removed)
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

 
Reply With Quote
 
Daniel T.
Guest
Posts: n/a
 
      10-22-2006
(E-Mail Removed) 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.
 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      10-22-2006
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.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.


 
Reply With Quote
 
Salt_Peter
Guest
Posts: n/a
 
      10-22-2006

(E-Mail Removed) 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.

 
Reply With Quote
 
gw7rib@aol.com
Guest
Posts: n/a
 
      10-22-2006

(E-Mail Removed) 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!

 
Reply With Quote
 
Mike Wahler
Guest
Posts: n/a
 
      10-22-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.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


 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      10-22-2006
Mike Wahler wrote:
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help, I am intermediate in Java...need help in follow case ElementX Java 9 10-01-2008 08:02 PM
Help Help. I really need some help with this =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 01-31-2007 09:33 PM
re_---need help Network Adapters!!!! NEED HELP!!!! hedayatniac@gmail.com Computer Support 4 08-13-2006 01:03 AM
Need help! I need to add lead zeros to a textbox Teep ASP .Net 2 06-21-2004 01:04 PM
Please help!!! Need datagrid selection to fill textboxes...Need quick!! TN Bella ASP .Net 1 06-18-2004 01:31 AM



Advertisments