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 number20
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