cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Return int
Return int
Feb 13, 2014 at 7:14pm UTC
Drae
(7)
int result = 15/2;
is it that result will now be 7 or 7.5. based on my understanding it will be 7. since it is returning an integer. am I correct to say that the .5 will be discarded.
Feb 13, 2014 at 7:30pm UTC
Guzfraba
(115)
Yes, you are right.
http://stackoverflow.com/questions/3602827/what-is-the-behavior-of-integer-division-in-c
Feb 13, 2014 at 8:15pm UTC
Drae
(7)
understand. thank you for the the additional info at the link
Topic archived. No new replies allowed.