Java를 이용한 Multiplication Table

2021. 8. 4. 22:13
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
        //While문을 이용해서 만들기        
 
        int gugu = 2;
        int times = 1;
        
        while(times <= 9) {
            
            gugu = 1;
            
            while(gugu <= 9) {
                System.out.print(gugu + " * " + times + " = "+ (gugu*times) + "\t");
                gugu++;
            }
            System.out.println();
            
            times++;
        }
 
 
 
 
        //For문을 이용해서 만들기
        
        for(int times_f = 2; times_f <= 9; times_f++) {
            
            for(int gugu_f = 2; gugu_f <= 9; gugu_f++) {
                
                System.out.print(gugu_f + " * " + times_f + " = "+ (gugu_f*times_f) + "\t");
                
            }
            
            System.out.println();
            
        }
cs

BELATED ARTICLES

more