control the operator evaluation sequence
using System;
public class MainClass {
static void Main(string[] args) {
int a;
a = -42;
Console.WriteLine("{0}", a);
int b = 2;
int c = 42;
a = b * (-c);
Console.WriteLine("{0}", a);
c = -42;
a = b * (+c);
Console.WriteLine("{0}", a);
}
}
Related examples in the same category