Skip to content

Commit fe3c36b

Browse files
authored
Merge pull request TheAlgorithms#365 from JeonSeongBae/SeongBaeJeon1
Add line that closing scanner
2 parents 58ddf8b + 1e38751 commit fe3c36b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Others/FibToN.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static void main(String[] args) {
99
// print fibonacci sequence less than N
1010
int first = 0, second = 1;
1111
//first fibo and second fibonacci are 0 and 1 respectively
12-
12+
scn.close();
1313
while(first <= N){
1414
//print first fibo 0 then add second fibo into it while updating second as well
1515

Others/FloydTriangle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public static void main(String[] args) {
66
Scanner sc = new Scanner(System.in);
77
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
88
int r = sc.nextInt(), n = 0;
9-
9+
sc.close();
1010
for(int i=0; i < r; i++) {
1111
for(int j=0; j <= i; j++) {
1212
System.out.print(++n + " ");

0 commit comments

Comments
 (0)