Declare char, double and decimal type variables - CSharp Language Basics

CSharp examples for Language Basics:Data Type

Description

Declare char, double and decimal type variables

Demo Code

using System;// w w w .  j  ava 2  s . c om
class Program
{
   static void Main(string[] args)
   {
      char myChar = 'A';
      Console.WriteLine("myChar = {0}", myChar);
      double myDouble = 3.14;
      Console.WriteLine("myDouble = {0}", myDouble);
      decimal myDecimal = 35.123456789M;
      Console.WriteLine("myDecimal = {0}", myDecimal);
      Console.ReadKey();
   }
}

Result


Related Tutorials