|
-
July 25th, 1999, 04:59 PM
#1
Division in C++
In C++ how may I divide and get a floating point result (ie 7/4 = 1.75). Wound you have to do this, or rather is this the only way?
int a, b;
float answer, answer2;
a=7;
b=4;
answer = a/b;
answer2 = a%b;
answer += answer2;
Is this the only way to do it? Is this the best way if I must compare two division results and I have to be able to compare all of the decimal places also. Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|