From 35fd10d4c2ee7e39f30cdb175e0b42b93c378085 Mon Sep 17 00:00:00 2001 From: apedalrzaq1 Date: Fri, 14 Jul 2023 11:19:34 +0300 Subject: [PATCH] solve varible --- arthimetic-operators.js | 13 ++++++++ index.html | 3 ++ logical-comaprison-operators.js | 59 +++++++++++++++++---------------- 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/arthimetic-operators.js b/arthimetic-operators.js index 3ff7d54..0340ea1 100644 --- a/arthimetic-operators.js +++ b/arthimetic-operators.js @@ -18,6 +18,13 @@ Task 1: 7. Use console.log() to print the value of variable e to the console. (it should result 105.667) *******************************************************************************/ // TODO: ADD YOUR CODE BELOW +let a=4+6; +let b=10*5; +let c=17%3; +let d=b-a; +let e=a+b+c+d; +console.log(e); + /******************************************************************************* Task 2: @@ -28,3 +35,9 @@ Task 1: 5. Divide two numbers and round the result to the nearest integer before logging it to the console. *******************************************************************************/ // TODO: ADD YOUR CODE BELOW +s=4-1; +console.log(s); +let f=1+5+3+7; + + + diff --git a/index.html b/index.html index 9eb7d90..e231ad8 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,9 @@ + + + diff --git a/logical-comaprison-operators.js b/logical-comaprison-operators.js index aea6930..4673c27 100644 --- a/logical-comaprison-operators.js +++ b/logical-comaprison-operators.js @@ -6,35 +6,37 @@ TASK 1: // Have fun! // 😃 ********************************************************************************/ -const exp1 = 10 >= 10; // TODO: ADD YOUR EVALUATION HERE --> +const exp1 = 10 >= 10; // TODO: ADD YOUR EVALUATION HERE --> true -const exp2 = "dog" == "dog"; // TODO: ADD YOUR EVALUATION HERE --> +const exp2 = "dog" == "dog"; // TODO: ADD YOUR EVALUATION HERE --> true +console.log(exp2); -const exp3 = true != false; // TODO: ADD YOUR EVALUATION HERE --> +const exp3 = true != false; // TODO: ADD YOUR EVALUATION HERE --> true -const exp4 = "10" === 10; // TODO: ADD YOUR EVALUATION HERE --> +const exp4 = "10" === 10; // TODO: ADD YOUR EVALUATION HERE --> false -const exp5 = 5 > 4; // TODO: ADD YOUR EVALUATION HERE --> +const exp5 = 5 > 4; // TODO: ADD YOUR EVALUATION HERE --> true -const exp6 = null == undefined; // TODO: ADD YOUR EVALUATION HERE --> +const exp6 = null == undefined; // TODO: ADD YOUR EVALUATION HERE --> false -const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE --> +const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE --> true -const exp8 = "false" == false; // TODO: ADD YOUR EVALUATION HERE --> +const exp8 = "false" == false; // TODO: ADD YOUR EVALUATION HERE --> true -const exp9 = NaN === NaN; // TODO: ADD YOUR EVALUATION HERE --> +const exp9 = NaN === NaN; // TODO: ADD YOUR EVALUATION HERE --> true -const exp10 = !false || false; // TODO: ADD YOUR EVALUATION HERE --> +const exp10 = !false || false; // TODO: ADD YOUR EVALUATION HERE --> true -const exp11 = false && !false; // TODO: ADD YOUR EVALUATION HERE --> +const exp11 = false && !false; // TODO: ADD YOUR EVALUATION HERE --> false -const exp12 = "apple" > "pineapple"; // TODO: ADD YOUR EVALUATION HERE --> +const exp12 = "apple" > "pineapple"; // TODO: ADD YOUR EVALUATION HERE --> false +console.log(exp12); -const exp13 = "2" > "12"; // TODO: ADD YOUR EVALUATION HERE --> +const exp13 = "2" > "12"; // TODO: ADD YOUR EVALUATION HERE --> false -const exp14 = undefined == null; // TODO: ADD YOUR EVALUATION HERE --> +const exp14 = undefined == null; // TODO: ADD YOUR EVALUATION HERE --> false -const exp15 = undefined === null; // TODO: ADD YOUR EVALUATION HERE --> +const exp15 = undefined === null; // TODO: ADD YOUR EVALUATION HERE --> false /******************************************************************************* Task 2: @@ -46,34 +48,35 @@ const str = "Hakuna Matata"; const isHappy = false; // - Check if num is between 10 and 20 (inclusive) using the logical AND operator. Log the result to the console. -// TODO: ADD YOUR CODE BELOW +// TODO: ADD YOUR CODE BELOW ---true +console.log(num>10 && num<=20); // - Check if num is either less than 5 or greater than 50 using the logical OR operator. Log the result to the console. -// TODO: ADD YOUR CODE BELOW - +// TODO: ADD YOUR CODE BELOW-- false +console.log(num<5&&num>50); // - Check if str is either "apple" or "orange" using the logical OR operator. Log the result to the console. -// TODO: ADD YOUR CODE BELOW - +// TODO: ADD YOUR CODE BELOW--false +console.log(str=="apple"||str=="orange"); // - Check if isHappy value is true using the logical NOT operator. Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(isHappy==!true); // - Check if num is even and greater than 10 using the logical AND operator. Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(num%2==0&&num>10); // - Check if num is divisible by both 3 and 5 using the logical OR operator. Log the result to the console. -// TODO: ADD YOUR CODE BELOW - +// TODO: ADD YOUR CODE BELOW --flase +console.log((num % 3==0)||(num % 5==0)); // - Check if str contains the letter "e". Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(); // - Check if str starts with "Hakuna". Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(); // - Check if str ends with "a". Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(); // - Check if num is either negative or odd using the logical OR operator. Log the result to the console. // TODO: ADD YOUR CODE BELOW - +console.log(); // - Check if the length of str is greater than num or equal to 40 using logical OR operator. Log the result to the console. // TODO: ADD YOUR CODE BELOW