From 1a59d552ead722dcf0dacb2d1fd5a72fd680565e Mon Sep 17 00:00:00 2001 From: Akshay Kudtarkar <55323340+akshay1552@users.noreply.github.com> Date: Wed, 27 Oct 2021 16:34:39 +0530 Subject: [PATCH 1/2] Update HelloWorld.java --- HelloWorld.java | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/HelloWorld.java b/HelloWorld.java index d13c25e..1ef0334 100644 --- a/HelloWorld.java +++ b/HelloWorld.java @@ -1,9 +1,16 @@ - -/** - * The HelloWorldApp class implements an application that simply prints "Hello World" to standard output. - */ -public class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello, World"); - } -} +import java.util.*; +class UserInputDemo +{ +public static void main(String[] args) +{ +Scanner sc= new Scanner(System.in); //System.in is a standard input stream +System.out.print("Enter first number- "); +int a= sc.nextInt(); +System.out.print("Enter second number- "); +int b= sc.nextInt(); +System.out.print("Enter third number- "); +int c= sc.nextInt(); +int d=a+b+c; +System.out.println("Total= " +d); +} +} From 0419b01d84bb59e49bd1b6380a8cdd838ac11494 Mon Sep 17 00:00:00 2001 From: Akshay Kudtarkar <55323340+akshay1552@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:30:52 +0530 Subject: [PATCH 2/2] Update HelloWorld.java --- HelloWorld.java | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/HelloWorld.java b/HelloWorld.java index 1ef0334..d13c25e 100644 --- a/HelloWorld.java +++ b/HelloWorld.java @@ -1,16 +1,9 @@ -import java.util.*; -class UserInputDemo -{ -public static void main(String[] args) -{ -Scanner sc= new Scanner(System.in); //System.in is a standard input stream -System.out.print("Enter first number- "); -int a= sc.nextInt(); -System.out.print("Enter second number- "); -int b= sc.nextInt(); -System.out.print("Enter third number- "); -int c= sc.nextInt(); -int d=a+b+c; -System.out.println("Total= " +d); -} -} + +/** + * The HelloWorldApp class implements an application that simply prints "Hello World" to standard output. + */ +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World"); + } +}