File tree 4 files changed +24
-6
lines changed
4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .Scanner ;
2
+
3
+ class convert {
4
+ public static void main (String [] args ){
5
+ Scanner sc = new Scanner (System .in );
6
+ int n = sc .nextInt ();
7
+ while (n --> 0 ){
8
+ int m = sc .nextInt ();
9
+ int [] arr = new int [m ];
10
+ for (int i = 0 ; i < m ; i ++){
11
+ arr [i ] = sc .nextInt ();
12
+ }
13
+
14
+ }
15
+ }
16
+ }
Original file line number Diff line number Diff line change 5
5
class fibo_recu {
6
6
static int n1 =0 ,n2 =1 ,n3 =0 ;
7
7
static void printFeb (int count ){
8
- if (count > 0 ){
8
+ if (count >= 0 ){
9
9
n3 = n1 + n2 ;
10
10
System .out .print (" " +n3 );
11
11
n1 = n2 ;
@@ -15,10 +15,11 @@ static void printFeb(int count){
15
15
}
16
16
public static void main (String args []){
17
17
Scanner sc = new Scanner (System .in );
18
- System .out .print ("Enter the no you want to print: " );
19
18
int count = sc .nextInt ();
19
+ System .out .print ("Fibonacci series up to " + count + "th term :" );
20
+ // int count = sc.nextInt();
20
21
sc .close ();
21
- System .out .print ("The Fibonacci is: " + n1 +" " +n2 );
22
+ System .out .print ( n1 +" " +n2 );
22
23
printFeb (count - 2 );
23
24
}
24
25
}
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ public static void main(String args[]){
8
8
int n1 = 0 ,n2 = 1 ,n3 =0 ;
9
9
int count = sc .nextInt ();
10
10
sc .close ();
11
+ System .out .println ("fibonacci series up to " + count + "th term :" );
11
12
System .out .print (n1 +" " +n2 );
12
- for (int i = 2 ; i < count ; i ++){
13
+ for (int i = 2 ; i <= count ; i ++){
13
14
n3 = n1 +n2 ;
14
15
System .out .print (" " +n3 );
15
16
n1 = n2 ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ public static void main(String[] args){
6
6
System .out .print (" " );
7
7
}
8
8
for (int j = i ; j <= n ; j ++){
9
- System .out .print ("* " );
9
+ System .out .print ("*" );
10
10
}
11
11
System .out .println (" " );
12
12
}
@@ -16,7 +16,7 @@ public static void main(String[] args){
16
16
System .out .print (" " );
17
17
}
18
18
for (int j = 1 ; j <= i ; j ++){
19
- System .out .print ("* " );
19
+ System .out .print ("*" );
20
20
}
21
21
System .out .println (" " );
22
22
}
You can’t perform that action at this time.
0 commit comments