C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 23rd, 2004, 11:43 AM
Etarr18 Etarr18 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Etarr18 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Small question

How would I code a program to find the largest of 3 intergers and then check to see if the sum of the 2 smaller ones is > than the largest?

Reply With Quote
  #2  
Old September 23rd, 2004, 01:46 PM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
1) Open your text editor/ide.
2) Write the code.
3) Compile it.
4) Test it.
5) Fix any problems.

More importantly, have a go for yourself and if you get stuck on something specific ask us for help.

-KM-

Reply With Quote
  #3  
Old September 23rd, 2004, 04:06 PM
The Phantom The Phantom is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: In the Dark City
Posts: 46 The Phantom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to The Phantom
Quote:
Originally Posted by Etarr18
How would I code a program to find the largest of 3 intergers and then check to see if the sum of the 2 smaller ones is > than the largest?
Like this:
Code:
 
String num1, num2, num3, num4, num5;///so on...
 
cout << "Enter a number";
cin >> num1;
 
cout << "Enter another number ";
cin >> num2;
 
cout << " Enter another";
cin >> num3;
 
cout << "and another";
cin >> num4;
 
cout << " and another";
cin >> num5;
 
if num1 > num2
if num1 > num4
if num1 > num3
if num1 > num5
cout << num1 ;
 
if num2 > num1
if num2 > num3
if num2 > num4
if num2 > num5
cout << num2;
///so on so on// 

I dont know if this is correct but you can try it. Try the sum part if you need help ask>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Small question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT