Somebody should help me tom score one and bob lose one how should i write initially they have same score | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Somebody should help me tom score one and bob lose one how should i write initially they have same score

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //taking initial score int initScore = scanner.nextInt(); int scoreTom = initScore; int scoreBob = initScore; System.out.println("Round 1 results:"); scoreTom=++initScore; scoreBob=initScore; System.out.println(scoreTom); System.out.println(scoreBob); } }

23rd Jun 2021, 10:47 AM
Usman Muhammad Bukar
Usman Muhammad Bukar - avatar
1 Answer
+ 1
//is this what you are looking.. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //taking initial score int initScore = scanner.nextInt(); int scoreTom = initScore; int scoreBob = initScore; System.out.println("Round 1 results:"); //scoreTom=++initScore; // scoreBob=initScore; System.out.println(++scoreTom); System.out.println(--scoreBob); } }
23rd Jun 2021, 10:58 AM
Jayakrishna 🇮🇳