how to compare two double datatype values in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gayathiri123
    New Member
    • Jun 2015
    • 1

    #1

    how to compare two double datatype values in C#

    I am not able to compare two double values in c#

    Ex:

    double x=36.2444
    double Y=35.2244
    if(X < Y)
    Console.writeli ne(the value of X:",X);
  • computerfox
    Contributor
    • Mar 2010
    • 276

    #2
    I believe the x is lowercase. Can you try again and let us know?
    Also, when you're printing the content, I believe it should be:
    Code:
    Console.writeline("The value of X: "+x);

    Comment

    Working...