Page 143 - Computer Software Application TP - Volume 1
P. 143

COMPUTER SOFTWARE APPLICATION - CITS



              let sum = a + b;

              let difference = a - b;
              let product = a * b;
              let quotient = a / b;
              let remainder = a % b;
              console.log(“Sum:”, sum); // Output: 15

              console.log(“Difference:”, difference); // Output: 5
              console.log(“Product:”, product); // Output: 50
              console.log(“Quotient:”, quotient); // Output: 2
              console.log(“Remainder:”, remainder); // Output: 0
              // String Concatenation Expression

              let firstName = “John”;
              let lastName = “Doe”;
              let fullName = firstName + “ “ + lastName;
              console.log(“Full Name:”, fullName); // Output: John Doe
              // Comparison Expressions

              let x = 10;
              let y = 5;
              let isEqual = x === y;
              console.log(“Is x equal to y?”, isEqual); // Output: false

              // Logical Expressions
              let isAdult = true;
              let hasLicense = false;
              let canDrive = isAdult && hasLicense;
              console.log(“Can drive?”, canDrive); // Output: false
              </script>

              </body>
              </html>




























                                                           128
                               CITS : IT & ITES - Computer Software Application - Exercise 38
   138   139   140   141   142   143   144   145   146   147   148