My changes

This commit is contained in:
gokul
2025-08-16 19:51:23 +05:30
parent 4c1f0b28b6
commit 310159401b
2 changed files with 24 additions and 0 deletions

23
AddTwoNumbers.java Normal file
View File

@ -0,0 +1,23 @@
import java.util.Scanner;
public class AddTwoNumbers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Take input for first number
System.out.print("Enter first number: ");
int num1 = scanner.nextInt();
// Take input for second number
System.out.print("Enter second number: ");
int num2 = scanner.nextInt();
// Add the numbers
int sum = num1 + num2;
// Display result
System.out.println("The sum of " + num1 + " and " + num2 + " is: " + sum);
scanner.close();
}
}

View File

@ -1,6 +1,7 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, Git and Java!");
//welcome
}
}