-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoops.java
More file actions
40 lines (29 loc) · 790 Bytes
/
Loops.java
File metadata and controls
40 lines (29 loc) · 790 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
35
36
37
38
39
40
package com.beyzakaynar.javalearning;
public class Loops {
public static void main(String[] args) {
//for loop
int[] myNumbers = {12,15,18,21,24};
int x = myNumbers[0]/3*5;
System.out.println(x);
for (int i=0;i<myNumbers.length;i++){
int y = myNumbers[i]/3*5;
System.out.println(y);
}
for (int number: myNumbers){
int z = number/3*5;
System.out.println(z);
}
//Özellikle diziler için kullanýlýr
for (int a= 0;a<10;a++){
int b = a*10;
System.out.println(b);
}
int j=0;
//while loop
while (j<10){
int m = j*10;
System.out.println(m);
j++;
}
}
}