import java.util.Scanner;
public class TemperatureConverter2
{
//-----------------------------------------------------------------
// using scanner to give input
//-----------------------------------------------------------------
public static void main (String[] args)
{
double celsius;
Scanner scan = new Scanner (System.in);
System.out.println ("Enter celsius :");
celsius = scan.nextDouble();
double fahrenheit;
fahrenheit= (celsius * 9/5 + 32);
System.out.println ("fahrenheit is :" + fahrenheit);
}
}
GO TO CHAPTER 3
Browse: Home > scanner function(celsius convert to fahrenheit )
0 Comments:
Post a Comment