473,385 Members | 1,844 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,385 software developers and data experts.

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.

Oct 22 '06 #1
8 1188
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!!!
Oct 22 '06 #2
On 21 Oct 2006 20:36:19 -0700 in comp.lang.c++, h1*****@gmail.com
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

Oct 22 '06 #3
h1*****@gmail.com 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.
Oct 22 '06 #4
<h1*****@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro 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.
Oct 22 '06 #5

h1*****@gmail.com 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.

Oct 22 '06 #6

h1*****@gmail.com 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! :-)

Oct 22 '06 #7

<h1*****@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro 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
Oct 22 '06 #8
Mike Wahler wrote:
<h1*****@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro 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.
Oct 22 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
5
by: John Flynn | last post by:
hi all i'm going to be quick i have an assignment due which i have no idea how to do. i work full time so i dont have the time to learn it and its due date has crept up on me .. As follows:...
0
by: xunling | last post by:
i have a question about answering ..... this topic is "need help" what do i have to write at te topic line, !after i have klicked the "answer message" button ive tried many possibilities,...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.