Write a program that assigns the value 25 to variable
x
, and 5 to variable y
. Output the sum, difference, product,
quotient, and modulus of x
and
y
.
What will be the output of the following method?
static void Main( ) { int varA = 5; int varB = ++varA; int varC = varB++; Console.WriteLine( "A: {0}, B: {1}, C: {2}", varA, varB, varC ); }
Write a program that demonstrates the difference between the prefix and postfix operators.