Skip to content

Commit

Permalink
Merge pull request TheAlgorithms#365 from JeonSeongBae/SeongBaeJeon1
Browse files Browse the repository at this point in the history
Add line that closing scanner
  • Loading branch information
varunu28 authored Dec 19, 2017
2 parents 58ddf8b + 1e38751 commit fe3c36b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Others/FibToN.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void main(String[] args) {
// print fibonacci sequence less than N
int first = 0, second = 1;
//first fibo and second fibonacci are 0 and 1 respectively

scn.close();
while(first <= N){
//print first fibo 0 then add second fibo into it while updating second as well

Expand Down
2 changes: 1 addition & 1 deletion Others/FloydTriangle.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
int r = sc.nextInt(), n = 0;

sc.close();
for(int i=0; i < r; i++) {
for(int j=0; j <= i; j++) {
System.out.print(++n + " ");
Expand Down

0 comments on commit fe3c36b

Please sign in to comment.