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. 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!!!
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
<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. 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. 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! :-)
<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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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,...
|
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:...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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 ...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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
|
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...
|
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...
| |