-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQue-41.java
More file actions
26 lines (24 loc) · 849 Bytes
/
Copy pathQue-41.java
File metadata and controls
26 lines (24 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Consider the equation p= sinx + cosy+ tanz , Create 3 threads with each one computing sinx, cosy, tanz . Obtain the sum of 3 terms and display.
//By: Parth Panjwani
class Que41 {
public static void main(String[] args) {
Thread t1 = new Thread(new Runnable() {
public void run() {
System.out.println("Sinx: "+Math.sin(Math.PI/2));
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
System.out.println("Coxy: "+Math.cos(Math.PI/2));
}
});
Thread t3 = new Thread(new Runnable() {
public void run() {
System.out.println("Tanz: "+Math.tan(Math.PI/2));
}
});
t1.start();
t2.start();
t3.start();
}
}