added a new varible z

This commit is contained in:
Sage Burger 2023-08-16 13:31:08 +02:00
parent d724c9251b
commit c13302d9f5
2 changed files with 6 additions and 5 deletions

Binary file not shown.

View file

@ -10,17 +10,18 @@ public class App {
// Creating a Random object
Random random = new Random();
// Define the range for x and y
int minRange = -1000;
int maxRange = 1000;
// Define the range for x, y and z
int minRange = -10000;
int maxRange = 10000;
// Generate random values for x and y within the specified range
int x = random.nextInt(maxRange - minRange + 1) + minRange;
int y = random.nextInt(maxRange - minRange + 1) + minRange;
int z = random.nextInt(maxRange - minRange + 1) + minRange;
int sum = x + y;
int sum = x + y + z;
System.out.println("The sum of " + x + " and " + y + " is: " + sum);
System.out.println("The sum of " + x + " " + y + " and " + z + " is: " + sum);
System.out.println("May the code be with you!");
}