From 3f1ec6b1d7f3bbd11228e21459363d127feebab2 Mon Sep 17 00:00:00 2001 From: Sakshi Ojha <127045654+Sakshi-2707@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:38:02 +0530 Subject: [PATCH 1/2] Create Celsius_to_fahrenheit.java --- Celsius_to_fahrenheit.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Celsius_to_fahrenheit.java diff --git a/Celsius_to_fahrenheit.java b/Celsius_to_fahrenheit.java new file mode 100644 index 0000000..5032bde --- /dev/null +++ b/Celsius_to_fahrenheit.java @@ -0,0 +1,10 @@ +class Celsius_to_fahrenheit { + public static void main(String[] args) + { + double celsius = 10.0, fahrenheit = 0.0; + fahrenheit = (celsius * 1.8) + 32; + System.out.println( + " value of temperature in fahrenheit:" + + fahrenheit); + } +} From 313bba1ee292585a36714c9b44b4960eba322778 Mon Sep 17 00:00:00 2001 From: Sakshi Ojha <127045654+Sakshi-2707@users.noreply.github.com> Date: Sun, 15 Oct 2023 20:42:12 +0530 Subject: [PATCH 2/2] Update Celsius_to_fahrenheit.java --- Celsius_to_fahrenheit.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Celsius_to_fahrenheit.java b/Celsius_to_fahrenheit.java index 5032bde..bbbdb85 100644 --- a/Celsius_to_fahrenheit.java +++ b/Celsius_to_fahrenheit.java @@ -1,10 +1,12 @@ -class Celsius_to_fahrenheit { +import java.util.*; + class Celsius_to_fahrenheit { public static void main(String[] args) { - double celsius = 10.0, fahrenheit = 0.0; + System.out.println("Enter value in celcius"); + Scanner sc = new Scanner(System.in); + double celsius = sc.nextDouble(); + double fahrenheit = 0.0; fahrenheit = (celsius * 1.8) + 32; - System.out.println( - " value of temperature in fahrenheit:" - + fahrenheit); + System.out.println("Value of temperature in fahrenheit:" + fahrenheit); } }