output different on home linux and on ISP.

Neil neil@pacifier.com
Wed Sep 29 08:47:00 GMT 1999


I am learning C and wrote the following simple code and
compiled it on my ISP's OpenBSD system:

#include <stdio.h>

main ()
{
int a = 25, b = 5, c = 10, d = 7;

printf ("a %% b = %i\n", a % b);
printf ("a %% c = %i\n", a % c);
printf ("a %% d = %i\n", a % d);
printf ("a / d * d + a %% d = %i\n", a / d * d + a % d);

}

a % b = 0
a % c = 5
a % d = 4
a / d * d + a % d = 25

However, on my home RH Linux 5.2 system, the same code compiles
successfully but the output is different:

It asks "What number?"
I give a number then it returns me to the prompt.

Then back to the prompt. What in the world is going on? thanks.

Neil


More information about the Gcc-help mailing list