-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay11.js
More file actions
101 lines (74 loc) · 2.86 KB
/
Day11.js
File metadata and controls
101 lines (74 loc) · 2.86 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Write the Pseudocode for the below:
// You are given three numbers stored in three variables, with the names num1, num2, and num3.
// Print the result of the following operations:
// num1 > num2 && num1 > num3-> this operation prints true if num1 is greater than both num2 and num3, otherwise it prints false.
// num2 > num1 && num2 > num3 -> this operation prints true if num2 is greater than both num1 and num3, otherwise it prints false.
// num3 > num1 && num3 > num2 -> this operation prints true if num3 is greater than both num1 and num2, otherwise it prints false.
// num1 = 10;
// num2 = 20;
// num3 = 30;
// if (num1 > num2 && num1 > num3) print("true");
// else print("false");
// if (num2 > num1 && num2 > num3) print("true");
// else print("false");
// if (num3 > num1 && num3 > num2) print("true");
// else print("false");
// Problem Description
// Write the pseudocode for the following:
// You are provided with the radii of two circles.
// For the first circle, the radius is R1, and for the second circle,
// the radius is R2. You need to determine if the area of the first circle is greater than the second,
// and if the circumference of the first circle is greater than the second.
// Input Format:
// The first line of input contains two space-separated integers
// representing the radii of two circles: R1 and R2.
// Output Format:
// On the first line, print "true" if the area of circle 1 is
// greater than the area of circle 2; otherwise, print "false".
// On the second line, print "true" if the circumference of circle 1 is greater
// than the circumference of circle 2; otherwise, print "false".
// let arr = [3,5,2,7,10,9];
// let n = arr.length;
// let temp1 = arr[0];
// let temp2 = arr[n-1];
// let res = 0;
// for(let i=0; i<n; i++)
// {
// if(temp1<arr[i] && arr[i]<temp2) // 3<3<9
// {
// res = arr[i];
// }
// }
// console.log(res);
// Problem Description
// Write the pseudocode for the following:
// You are provided with the radii of two circles.
// For the first circle, the radius is R1, and for the second circle,
// the radius is R2. You need to determine if the area of the first circle
// is greater than the second, and if the circumference of the first circle is greater
// than the second.
// Input Format:
// The first line of input contains two space-separated
// integers representing the radii of two circles: R1 and R2.
// Output Format:
// On the first line, print "true" if the area of circle 1 is greater
// than the area of circle 2; otherwise, print "false". On the second line,
// print "true" if the circumference of circle 1 is greater than the circumference of circle 2; otherwise, print "false".
let R1 = 3;
let R2 = 4;
if(3.14*R1*R2 > 3.14*R2*R2)
{
console.log('true');
}
else
{
console.log('false');
}
if(2*3.14*R1 > 2*3.14*R2)
{
console.log('true');
}
else
{
console.log('false');
}