We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 58ddf8b + 1e38751 commit fe3c36bCopy full SHA for fe3c36b
Others/FibToN.java
@@ -9,7 +9,7 @@ public static void main(String[] args) {
9
// print fibonacci sequence less than N
10
int first = 0, second = 1;
11
//first fibo and second fibonacci are 0 and 1 respectively
12
-
+ scn.close();
13
while(first <= N){
14
//print first fibo 0 then add second fibo into it while updating second as well
15
Others/FloydTriangle.java
@@ -6,7 +6,7 @@ public static void main(String[] args) {
6
Scanner sc = new Scanner(System.in);
7
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
8
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 + " ");
0 commit comments