Int and float value

image_pdfimage_print

   
 
/*
Learning C# 
by Jesse Liberty

Publisher: O'Reilly 
ISBN: 0596003765
*/

 using System;

 public class IntFloatTester
 {
     public static void Main()
     {
         int smallInt = 5;
         int largeInt = 12;
         int intQuotient;
         intQuotient = largeInt / smallInt;
         Console.WriteLine("Dividing integers. {0} / {1} = {2}",
             largeInt, smallInt, intQuotient);

         float smallFloat = 5;
         float largeFloat = 12;
         float FloatQuotient;
         FloatQuotient = largeFloat / smallFloat;
         Console.WriteLine("Dividing floats. {0} / {1} = {2}",
             largeFloat, smallFloat, FloatQuotient);

     }
 }
           
         
     


This entry was posted in Data Types. Bookmark the permalink.