File tree Expand file tree Collapse file tree 4 files changed +64
-2
lines changed Expand file tree Collapse file tree 4 files changed +64
-2
lines changed Original file line number Diff line number Diff line change 1
- import java .util .Collection ;
2
- import java .util .Iterator ;
3
1
import java .util .LinkedList ;
4
2
import java .util .Queue ;
5
3
public class BinaryTreeYT {
Original file line number Diff line number Diff line change
1
+ package binod ;
2
+ import java .util .Scanner ;
3
+ public class CheckPrime {
4
+ public static void main (String [] args ) {
5
+ int flag =0 ;
6
+ Scanner scanner =new Scanner (System .in );
7
+ System .out .println ("Input some number" );
8
+ int inputNumber =scanner .nextInt ();
9
+ for (int i =2 ;i <inputNumber ;i ++){
10
+ if (inputNumber %i ==0 ){
11
+ flag =1 ;
12
+ break ;
13
+ }
14
+ }
15
+ if (flag ==0 ){
16
+ System .out .println ("prime" );
17
+
18
+ }else {
19
+ System .out .println ("not prime" );
20
+ }
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ package binod ;
2
+ import java .util .Scanner ;
3
+ public class MaxThreeNumber {
4
+ public static void main (String [] args ) {
5
+ Scanner scanner =new Scanner (System .in );
6
+ System .out .println ("Input first number" );
7
+ int firstNumber =scanner .nextInt ();
8
+ System .out .println ("Input second number" );
9
+ int secondNumber =scanner .nextInt ();
10
+ System .out .println ("Input third number" );
11
+ int thirdNumber =scanner .nextInt ();
12
+
13
+ if (firstNumber >secondNumber ){
14
+ if (firstNumber >thirdNumber ){
15
+ System .out .println (firstNumber );
16
+ }else {
17
+ System .out .println (thirdNumber );
18
+ }
19
+
20
+ }else {
21
+ if (secondNumber >thirdNumber ){
22
+ System .out .println (secondNumber );
23
+ }else {
24
+ System .out .println (thirdNumber );
25
+ }
26
+ }
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ package binod ;
2
+ import java .util .Scanner ;
3
+ public class SumTwoNumber {
4
+ public static void main (String [] args ) {
5
+ Scanner scanner =new Scanner (System .in );
6
+ System .out .println ("Enter first number: " );
7
+ int firstNumber =scanner .nextInt ();
8
+ System .out .println ("Enter second number: " );
9
+ int secondNumber =scanner .nextInt ();
10
+ int sum =firstNumber +secondNumber ;
11
+ System .out .println (sum );
12
+
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments