944,033 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1195
  • C++ RSS
Apr 29th, 2007
0

1%2 ? what is the answer ???

Expand Post »
Hello;

can any 1 tell me what is the answer for the following statement :

1%10

and

1%2



Similar Threads
Zay
Reputation Points: 14
Solved Threads: 0
Junior Poster in Training
Zay is offline Offline
92 posts
since Apr 2007
Apr 29th, 2007
0

Re: 1%2 ? what is the answer ???

Can you spend 10 seconds writing a 1 line program to show you the answers?
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Apr 29th, 2007
0

Re: 1%2 ? what is the answer ???

the answer is 1 , you should have found it out yourself, x%y = x-(x/y)*y (integer division)
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006
Apr 29th, 2007
0

Re: 1%2 ? what is the answer ???

Click to Expand / Collapse  Quote originally posted by Zay ...
Hello;

can any 1 tell me what is the answer for the following statement :

1%10

and

1%2



Is you question what is it and how it works?. Look for the modulus operator.
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Please help about USER INPUT
Next Thread in C++ Forum Timeline: how to set the window position of my console applicaton ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC