i was given this program by my teacher. it converts decimal number to binary number.. Why is that FIX kept in front of (n/2) ...6th line of the program. why is that FIX written and why? i didn't get it

CLS
INPUT “ENTER A NUMBER”; N
WHILE N <> 0
A = N MOD 2
B$ = STR$(A)
N = FIX(N / 2)
C$ = B$ + C$
WEND
PRINT “BINARY EQUIVALENT IS”; C$
END

Both the Int(Number) and Fix(Number) functions remove the fractional part of Number and return the resulting integer value.

The difference between Int and Fix functions is that if Number is negative, Int returns the first negative integer less than or equal to Number, whereas Fix returns the first negative integer greater than or equal to Number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.

source:
https://msdn.microsoft.com/en-us/library/xh29swte(v=vs.90).aspx

thank you very much

The FIX function in the 6th line of the program is used to convert the result of the division of N by 2 to an integer value. In this case, it is used to round down the result of the division to the nearest whole number.

The reason for using FIX in this program is to ensure that the number N is treated as an integer when dividing it by 2. In some programming languages, if N is defined as a floating-point number (with a decimal part) and then divided by 2, the result would also include the decimal part. However, in this program, we only want the whole number part of the result because we are converting the decimal number to a binary number.

By using the FIX function, we can guarantee that the result of the division (N / 2) is rounded down to the nearest whole number. This ensures that the program works correctly when converting decimal numbers to binary numbers.

In summary, the FIX function is used in this program to convert the result of the division (N / 2) to an integer value by rounding it down to the nearest whole number.