Advertisement
stefanpu

Char, int and double comparison

Feb 17th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             //Initialization can ve regarded as input taken from the console through the
  15.             //"Console.ReadLine()" method.
  16.             int intValue = 0;
  17.             double doubleValue = 0;
  18.  
  19.            
  20.             Console.WriteLine("Double and int: " + (doubleValue==intValue));
  21.  
  22.             char charValue = '0';
  23.  
  24.             //Same input, different values
  25.             Console.WriteLine("Int and char: " + (intValue == charValue));            
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement