Wrox Programmer Forums
|
BOOK: Professional C++
This is the forum to discuss the Wrox book Professional C++ by Nicholas A. Solter, Scott J. Kleper; ISBN: 9780764574849
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2007, 07:09 AM
Registered User
 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default C program

write program accept 3 integer and print nearest two among them

pls give me result

 
Old March 11th, 2008, 06:29 PM
Authorized User
 
Join Date: Oct 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

7

----
Scott J. Kleper
Author, "Professional C++"
(Wrox, 2005)
 
Old October 17th, 2008, 01:03 AM
Authorized User
 
Join Date: Oct 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

C++ is one of the most popular programming languages, but this fast and powerful language is also notoriously complex. Many useful aspects of C++ remain a mystery to even the most experienced programmers. Too often, programming books concentrate more on the syntax of the language and less on its real-world applications. This code-intensive, practical guide changes that by teaching all facets of C++ development, including effective application design, testing, and debugging. You'll learn simple, powerful techniques used by C++ professionals, little-known features that will make your life easier, and reusable coding patterns that will bring your basic C++ skills to the professional level.
================================================== ========
Victor
Our mission is to provide high quality end to end solutions to the BPO segment in a manner that will improve the operational efficiency while reducing the cost of the services to the client.
[email protected]


 
Old March 29th, 2010, 08:55 PM
Authorized User
 
Join Date: Nov 2009
Posts: 26
Thanks: 1
Thanked 1 Time in 1 Post
Default

If you really want the program, here is the one I wrote 4 you:
Code:
#include <iostream.h>
#include <math.h>
#include <conio.h>

main()                      
{
   int a,b,c;  	//numbers
   int ab,ac,bc;	//difference of 2 numbers
                                                   
   cout<<"Enter three integers :\n";
   cin>>a>>b>>c;

   ab = abs(a-b);
   ac = abs(a-c);
   bc = abs(b-c);

   if(ab < ac && ab < bc)
   	cout<<a<<" and "<<b<<" are the nearest pair.\n";
   else if(ac < ab && ac < bc)
   	cout<<a<<" and "<<c<<" are the nearest pair.\n";
   else if(bc < ac && bc < ab)
   	cout<<b<<" and "<<c<<" are the nearest pair.\n";
   else
   	cout<<"Thre are more than 1 nearest pair.\n";

   getch();
   return 0;
}
Great wishes, Best luck...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to use for c# Doom C# 2005 2 January 4th, 2008 04:52 AM
What Program manih Assembly Language 1 December 1st, 2006 04:48 PM
Setup Project: Program not added in Start>Program arif_1947 VS.NET 2002/2003 2 March 31st, 2005 06:40 AM
Start a program inside another program Silje Classic ASP Professional 1 November 16th, 2004 02:08 AM
need help with a program captlem66 C++ Programming 2 October 16th, 2004 12:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.