Skip to content

Commit 0a9b1c7

Browse files
problme 39 solved
1 parent 77d681c commit 0a9b1c7

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

problme39/problme39.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
### (Part 1)
33
Jim is a meritorious student. He secures first place in his class all the time.
44
This year, Dela has joined his class. She was also a topper at her previous school.
5-
On the day of result publication, the teacher comes into the class with a delicious cake and says that "Jim & Dela, whoever is the topper,
6-
will get this tasty cake." Can you find out who will get this cake?
5+
On the day of result publication, the teacher comes into the class with a delicious cake and says that "Jim & Dela, whoever is the topper, will get this tasty cake." Can you find out who will get this cake?
76
87
**Input: The input line has two values, m (The marks Jim has got) and n (The marks Dela has got).**
98
**Output: Print the name of the topper.**
@@ -13,4 +12,24 @@ will get this tasty cake." Can you find out who will get this cake?
1312
1413
1514
2. Sample Input-2: 69 97
16-
- Sample Output-2: Dela */
15+
- Sample Output-2: Dela */
16+
17+
18+
19+
function findingTopper(m,n){
20+
if( m > n){
21+
return "Jim";
22+
}
23+
24+
else{
25+
return "Dela"
26+
}
27+
28+
};
29+
30+
31+
const jimsMarks = 69;
32+
const delasMarks = 97;
33+
34+
const theCakeWillGet = findingTopper(jimsMarks, delasMarks);
35+
console.log(theCakeWillGet);

0 commit comments

Comments
 (0)