,
Share with your friends 

Wrong answer in xflmoon

7 ratings Views 138 
Author: Nithiyanantham (Nithiyanantham L)  View Profile |  View other solutions by this author

Question / Problem


Symptom: There is a bug in the system 'cc' compiler, seen in some versions of DEC Ultrix, which will show up in xflmoon. A simpler version can be demonstrated in the following small program: #include < stdio.h > main() { int n = 10; n = n + ((int) (-0.99)); printf("%d\n",n); n = 10; n += ((int) (-0.99)); printf("%d\n",n); } This will produce output of 10 and 9, instead of the expected 10 10.

Solution

Solution:
You'll have to get an updated compiler version.

Applies to

C

Rank It

Login to rank it

Report


Advertisement