Declare two or more variables using the same declaration statement. Just separate their names by commas:
int x, y; // both declared using one statement
using System; class Example { public static void Main() { double s1 = 123.0, s2 = 1234.0; // dynamically initialize hypot double hypot = Math.Sqrt( (s1 * s1) + (s2 * s2) ); Console.Write("Hypotenuse of triangle with sides " + s1 + " by " + s2 + " is "); Console.WriteLine("{0:#.###}.", hypot); } }
Hypotenuse of triangle with sides 123 by 1234 is 1240.115.