title: Conversion from Fahrenheit to Celsius Method in Java
body: <pre><code>package n.pkg09;
  
  /**
   *
   * @author hachaudh
   */
  public class N09 {
  
      public static double CtoF(double Celsius) {
  
          System.out.println("Celsius |   Fahrenheit");
          System.out.println("");
          for (int i = 0; i &lt;= 50; i++) {
              Celsius = (i * (9.0 / 5.0)) + 32;
              System.out.printf("%4d     |    ", i);
              System.out.println((int) Celsius);
  
          }
  
          return Celsius;
      }
  
      public static double FtoC(double Fahrenheit) {
  
          System.out.println("Fahrenheit |   Celsius");
          System.out.println("");
          for (int i = 150; i &lt;= 220; i++) {
  
              Fahrenheit = (i * (5.0 / 9.0) - 32);
              System.out.printf("%4d       |    ", i);
              System.out.println((int) Fahrenheit);
  
          }
  
          return Fahrenheit;
      }
  
      public static void main(String[] args) {
  
          //CtoF(0);
          FtoC(0);
      }
  }
  </code></pre>
  
  <p>In the method FtoC (Fahrenheit to Celsius the conversions are all of 212 is suppose to equal 100 here is the output
  run:</p>
  
  <pre><code>Fahrenheit |   Celsius
  
   150       |    51
   151       |    51
   152       |    52
   153       |    53
   154       |    53
   155       |    54
   156       |    54
   157       |    55
   158       |    55
   159       |    56
   160       |    56
   161       |    57
   162       |    58
   163       |    58
   164       |    59
   165       |    59
   166       |    60
   167       |    60
   168       |    61
   169       |    61
   170       |    62
   171       |    63
   172       |    63
   173       |    64
   174       |    64
   175       |    65
   176       |    65
   177       |    66
   178       |    66
   179       |    67
   180       |    68
   181       |    68
   182       |    69
   183       |    69
   184       |    70
   185       |    70
   186       |    71
   187       |    71
   188       |    72
   189       |    73
   190       |    73
   191       |    74
   192       |    74
   193       |    75
   194       |    75
   195       |    76
   196       |    76
   197       |    77
   198       |    78
   199       |    78
   200       |    79
   201       |    79
   202       |    80
   203       |    80
   204       |    81
   205       |    81
   206       |    82
   207       |    83
   208       |    83
   209       |    84
   210       |    84
   211       |    85
   212       |    85
   213       |    86
   214       |    86
   215       |    87
   216       |    88
   217       |    88
   218       |    89
   219       |    89
   220       |    90
  BUILD SUCCESSFUL (total time: 0 seconds)
  </code></pre>