-4
using System;
namespace test_warmup
{
    class Program
    {
        static void Main(string[] args)
        {
            int test = -1110835200;
            test = test * 1700397056;
            Console.WriteLine(test);
        }
    }
}
Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Jeremy T
  • 1
  • 1

1 Answers1

2

-1110835200 * 1700397056 = -1888860903781171200

Displayed in hex, that's -0x1a3694fc_00000000

In C#, int is only 32-bits, so the result is truncated to just 0.

In other words, the result of that multiplication is too large to fit in the variable to which you're assigning it, and the part that fits is all zero.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328