Skip to content

Commit 5bd89c8

Browse files
committed
Program1
1 parent 76f3067 commit 5bd89c8

8 files changed

Lines changed: 91 additions & 0 deletions

bin/Day1/Cel2FahIIFah2Cel.class

892 Bytes
Binary file not shown.

bin/Day1/MultiplicationTable.class

960 Bytes
Binary file not shown.
1.33 KB
Binary file not shown.

bin/Day1/QuadricEquation.class

1.22 KB
Binary file not shown.

src/Day1/Cel2FahIIFah2Cel.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package Day1;
2+
3+
public class Cel2FahIIFah2Cel {
4+
5+
public static void main(String[] args) {
6+
7+
// Celcius to Fahrenheit
8+
9+
int celcius = 60;
10+
11+
double fah = celcius * 1.8 + 32;
12+
13+
System.out.println("Fahrenheit: " + fah);
14+
15+
// Fahrenheit to celcius
16+
17+
int fahr = 60;
18+
19+
double cel = (fahr - 32) / 1.8;
20+
21+
System.out.println("Celcius: " + cel);
22+
}
23+
24+
}

src/Day1/MultiplicationTable.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package Day1;
2+
3+
public class MultiplicationTable {
4+
5+
public static void main(String[] args) {
6+
7+
int tab = 3;
8+
int i = 1;
9+
while (i <= 10) {
10+
System.out.println(i + " * " + tab + " = " + i * 3);
11+
i++;
12+
}
13+
14+
}
15+
}

src/Day1/MultiplicationTables.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package Day1;
2+
3+
import java.util.Scanner;
4+
5+
public class MultiplicationTables {
6+
7+
public static void main(String[] args) {
8+
9+
10+
11+
//int a = 5;
12+
//int b = 7;
13+
14+
Scanner sc = new Scanner(System.in);
15+
System.out.println("Enter the Range");
16+
System.out.println("From");
17+
int a = sc.nextInt();
18+
System.out.println("To");
19+
int b = sc.nextInt();
20+
21+
for (int i = a; i <= b; i++) {
22+
System.out.println("Multiplication table of " + i);
23+
int j = 1;
24+
while (j <= 10) {
25+
System.out.println(j + " * " + i + " = " + j * i);
26+
j++;
27+
}
28+
}
29+
}
30+
}

src/Day1/QuadricEquation.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package Day1;
2+
3+
public class QuadricEquation {
4+
5+
public static void main(String[] args) {
6+
7+
int a = 2;
8+
int b = 6;
9+
int c = 4;
10+
11+
String eqn = a + "x2 + " + b + "x + " + c;
12+
13+
double value = Math.sqrt(b * b - 4 * a * c);
14+
System.out.println(value);
15+
16+
double value1 = (-b + value) / (2 * a);
17+
18+
double value2 = (-b - value) / (2 * a);
19+
20+
System.out.println("Value of " + eqn + " is " + value1 + " " + value2);
21+
}
22+
}

0 commit comments

Comments
 (0)