Uses various types of variables - CSharp Language Basics

CSharp examples for Language Basics:Variable

Description

Uses various types of variables

Demo Code

using System;/*from www. j a va 2 s . c  o m*/
class Program {
   static void Main(string[] args) {
      short a;
      int b ;
      double c;
      /* actual initialization */
      a = 10;
      b = 20;
      c = a + b;
      Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c);
      Console.ReadLine();
   }
}

Result


Related Tutorials