CSharp examples for Language Basics:Variable
Assign and print the value of variables
using System;/*w ww . j a va2s.co m*/ class MainClass { public static void Main() { int first_var; int second_var = 200; first_var = 5; Console.WriteLine("\nfirst_var contains the value {0}", first_var); Console.WriteLine("second_var contains the value {0}", second_var); first_var = 1010; second_var = 2020; Console.WriteLine("\nfirst_var contains the value {0}", first_var); Console.WriteLine("second_var contains the value {0}", second_var); } }