-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDortgenCizme.java
More file actions
34 lines (25 loc) · 888 Bytes
/
Copy pathDortgenCizme.java
File metadata and controls
34 lines (25 loc) · 888 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
32
33
34
/*
Dışarıdan en ve boy isimli iki tamsayı değerini giriş olarak alan bir program * sembollerinden oluşan
bir dörtgeni ekrana çizdirmektedir. Bu programın kodu istenmektedir.
tek bakışta anlanılabilecek bir örnek olduğundan açıklama satırı eklemedim.
*/
import java.util.Scanner;
public class DortgenCizme {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Lütfen en giriniz.");
int en = scanner.nextInt();
System.out.print("Lütfen boy giriniz");
int boy = scanner.nextInt();
cizdir(en, boy);
scanner.close();
}
static void cizdir(int en, int boy) {
for (int i = 0; i < boy; i++) {
for (int j = 0; j < en; j++) {
System.out.print("*");
}
System.out.println();
}
}
}