Create float literal and do calculation on it - CSharp Language Basics

CSharp examples for Language Basics:Float

Description

Create float literal and do calculation on it

Demo Code

using System;// ww w.  j a  v a  2s . co  m
class DifferentMagnitudes
{
   public static void Main()
   {
      float distance = 1234567000f;
      distance = distance - 5f;
      Console.WriteLine("New distance: " + distance);
   }
}

Result


Related Tutorials