Skip to content

Instantly share code, notes, and snippets.

@jukbot
Created December 1, 2015 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jukbot/39e90f9f4bcc67af74ec to your computer and use it in GitHub Desktop.
Save jukbot/39e90f9f4bcc67af74ec to your computer and use it in GitHub Desktop.
import java.util.Random;
import java.util.Scanner;
public class Random {
public static void main(String[] args) {
Random rand = newRandom();
int a = rand.nextInt(9);
int b = rand.nextInt(9);
System.out.println ("What is the answer of" a "+" b);
Scanner sc = new Scanner(System.in);
c = sc.nextInt();
if (a+b = c)
return true;
else
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment