Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming 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
  #1 (permalink)  
Old October 2nd, 2008, 06:50 AM
Authorized User
 
Join Date: Apr 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying the remainder

Hi Guys,
I need to do the following operation in c or c++:
15 / 2 = 7 r 1
I need to show the result which is 7 and the remainder which is 1.
How could i do that ?
thanks
curiaquita

Reply With Quote
  #2 (permalink)  
Old October 2nd, 2008, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

This is homework for some class, right?

So we shouldn't do homework for you or you'll never learn.

But I will give you two hints:

(1) Look at the % operator.

(2) Though you really don't need it. Just think about how INTEGER arithmetic works.
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying _doc_ Ave Python 1 June 3rd, 2008 01:11 PM
Compare Cells withThreshold & Output Remainder Neal Excel VBA 0 January 8th, 2008 07:50 AM
Displaying images...... kethireddy435 ASP.NET 2.0 Professional 0 September 16th, 2007 09:25 PM
Image not displaying shoakat ASP.NET 2.0 Professional 2 June 22nd, 2007 10:02 AM
gridview not displaying sarah lee ASP.NET 2.0 Basics 5 December 30th, 2006 05:28 AM





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