Tuesday, April 9

Generation of Pseudo in Java

Hi All,

Here I write a program for Generation of Pseudo in given limitation in Java :-)


import java.util.Random;
import java.util.Scanner;

public class PseudoNo {

    public static final void main(String... aArgs) {
        System.out.println("Enter the starting digits for Pseudo number ");
        int i1 = new Scanner(System.in).nextInt();
        System.out.println("Enter the ending digits for Pseudo number ");
        int limit = new Scanner(System.in).nextInt();       
        Random randomGenerator = new Random(); //Radom function for finding Pseudo Number
        for (int i = i1; i <= limit; ++i) {
            int randomInt = randomGenerator.nextInt(limit);
            System.out.println("Pseudo Numbers" + randomInt);
        }

        System.out.println("Done :-)");
    }
}

output:

~~~~~~

Enter the starting digits for Pseudo number
20
Enter the ending digits for Pseudo number
30
Pseudo Numbers15
Pseudo Numbers14
Pseudo Numbers3
Pseudo Numbers24
Pseudo Numbers23
Pseudo Numbers8
Pseudo Numbers16
Pseudo Numbers29
Pseudo Numbers10
Pseudo Numbers10
Pseudo Numbers22
Done.


No comments:

Post a Comment

Backup files to google drive using PHP coding

 Dear All, To backup files to Google Drive using PHP coding, you can use the Google Drive API and the Google Client Library for PHP. Here...