GTU OOP Program - 12

12). Write a program that creates a Random object with seed 1000 and displays the first 100 random integers between 1 and 49 using the NextInt (49) method.

class Program_12 {
    public static void main(String[] args) {
        java.util.Random randomNo = new java.util.Random(1000);

        // displays first 100 random integers between 0 to 49
        System.out.println(" 100 Random numbers are : ");
        for (int i = 0; i < 100; i++) {
            System.out.print(randomNo.nextInt(49) + " ");
        }
    }
}

Output
cse gtu, gtu study material for computer engineering students gujarat technological university oop lab manual solution

gtu oop lab manual,

oop GTU Practical,

oop Programs,

Object oriented Programming,

Gtu study material 3140705,

OOP 3140705,

oop practical list,

Java Programming,

gtu oop practical,

oop lab solution gtu

Comments

YouTube

Popular posts from this blog

GTU OOP Program - 18

GTU OS Program - 7

GTU OS Program - 3