- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathC01.java
More file actions
Latest commit
31 lines (21 loc) · 664 Bytes
/
Copy pathC01.java
File metadata and controls
31 lines (21 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
packaget1.proje;
importjava.util.Random;
importjava.util.Scanner;
publicclassC01 {
publicstaticvoidmain(String[] args) {
/*
* Soru 9 : ***** Zuhal Hanim ***** Veri tipi integer olan max sayısı
* verildiğinde
*
* 0 ile max sayisi arasindan random bir sayi elde et(olustur)
*
* output tipi int olmalı
*/
Scannerscan = newScanner (System.in);
System.out.println("max sayısını giriniz");
intmax=scan.nextInt();
Randomr=newRandom(); //random sınıfı
inta=r.nextInt(max);//0 ve negatifler dahil değil max da dahil değil
System.out.println(a);
scan.close(); }
}