I can't do this exercise please help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

I can't do this exercise please help me

The first two lines of the given code take two numbers as input. Task Complete the code to output whether or not the numbers are equal (true or false). Sample Input 11 11 Sample Output true Remember that all comparison operators always return true or false. For example: console.log(11==11) outputs true. exercice: var num1 = parseInt(readLine(), 10); var num2 = parseInt(readLine(), 10); //your code goes here

6th Jan 2022, 2:06 PM
Florian
11 Answers
+ 2
I succeeded thank you very much I saw too complicated when it was so simple the code was simply: var num1 = parseInt(readLine(), 10); var num2 = parseInt(readLine(), 10); //your code goes here console.log(num1==num2) Thank you Lisa and Solomoni Railoa !
6th Jan 2022, 2:53 PM
Florian
+ 3
Please read the task description again: in the bottom they give an example
6th Jan 2022, 2:14 PM
Lisa
Lisa - avatar
+ 2
Florian Great you solved!
6th Jan 2022, 2:53 PM
Lisa
Lisa - avatar
+ 2
Welldone you did it i was counting on you
7th Jan 2022, 12:58 PM
Sherzodbek Rahmatov
Sherzodbek Rahmatov - avatar
+ 1
Compare num1 and num2 for equality and output it
6th Jan 2022, 2:36 PM
Lisa
Lisa - avatar
+ 1
Do not remove the given code and do not hard code the input values! num1 and num2 are the input values, compare the variables num1 and num2 for equality. Also look at the example from the task description: you don't need an if-else statement
6th Jan 2022, 2:44 PM
Lisa
Lisa - avatar
0
Google the if statement that might be helpful
6th Jan 2022, 2:15 PM
Ayan Poddar
Ayan Poddar - avatar
0
I modified by putting the whole statement and yes i have to use console.log () for the right output
6th Jan 2022, 2:30 PM
Florian
0
I tried what Solomoni Raiola advised me but it didn't work var a = 3+3; //change this to input like above var b = 4+2; //with parseInt(readLine(),10); if (a==b) { console.log("true") } else{ console.log("false") } Test Case 1 Input 12 13 Your Output true Expected Output false (all other test cases are good)
6th Jan 2022, 2:42 PM
Florian
0
Hi
8th Jan 2022, 3:31 PM
Najmuddin saqib
Najmuddin saqib - avatar
- 1
Hi
8th Jan 2022, 1:53 PM
Krish Verma
Krish Verma - avatar