Do calculation with int variable in CSharp
Description
The following code shows how to do calculation with int variable.
Example
using System;/*w ww .j av a 2s .c o m*/
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);
}
}
The code above generates the following result.