English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

need to know how to find the remainder with decial numbers?

2007-02-27 13:46:48 · 4 answers · asked by bunnylover1987 1 in Computers & Internet Programming & Design

C programming!!!!!!!

2007-02-27 14:06:07 · update #1

4 answers

I'm not shure what language you are using but computers can do interger based math and give remainders.

In VB the MOD function divides one number by an other and returns the remainder.
Usually to do regular floating point division the '/' symbol is used. To do Integer based division the '\' symbol is used.

So to get your complete answer you will have to do two operations, an integer division and a MODULO (MOD) division

2007-02-27 14:06:18 · answer #1 · answered by MarkG 7 · 0 0

The % symbol is often used to show the modulo function. (Modulo returns the remainder of a division.) You can do this using MS Calculator. (Start > Programs > accessories > Calculator)

Make sure the scientific view is selected. Then, enter a value of 6, then press the MOD key, then enter 10, and then press the = key.

You'll get a value of 6, which is correct because 6/10 is 0.6, or 0 with a remainder of 6.

2007-02-27 14:06:57 · answer #2 · answered by BigRez 6 · 0 0

computers do not do remainders. It divides them out. For example, if you divide 3 into 10 you get 3 remainder 1. The computer gets you 3.333333333333

2007-02-27 13:51:51 · answer #3 · answered by Anonymous · 0 1

You are on the right track. % is the modulus operator.

To find a modulus, try something like this:

#include

int main(){
cout<<(10%6)< return 0;
}

This will return 4

2007-02-27 14:54:54 · answer #4 · answered by Amanda H 6 · 0 0

fedest.com, questions and answers