output different on home linux and on ISP.

Neil neil@pacifier.com
Wed Sep 29 09:15:00 GMT 1999


Now every program that I compile gives the same output:

What number?

Strange. Perhaps gcc is hosed. I have no idea how to fix
it. Any ideas on how to fix this would be appreciated. Thanks.

Neil



Neil <neil@pacifier.com> wrote:
> 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

-- 

Neil


More information about the Gcc-help mailing list