Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Lesson 9 Coding Activity Question 1
- *
- * Write the code to print a random integer from 1 to 10 inclusive using Math.random().
- *
- */
- import java.util.Scanner;
- import java.lang.Math;
- class Lesson_9_Activity_One {
- public static void main(String[] args) {
- int a;
- a = (int)(Math.random() * 20) - 20;
- System.out.println(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement