Advertisement
RokiAdhytama

Logical Operators - Chapter 9

Jul 3rd, 2022
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html xmlns = "http://www.w3.org/1999/xhtml">
  2.    <head>
  3.       <title>Demonstrating the Logical Operators</title>
  4.  
  5.       <script type = "text/javascript">
  6.          <!--
  7.          document.writeln(
  8.             "<table border = \"1\" width = \"100%\">" );
  9.  
  10.          document.writeln(
  11.             "<caption>Demonstrating Logical " +
  12.             "Operators</caption" );
  13.  
  14.          document.writeln(
  15.             "<tr><td width = \"25%\">Logical AND (&&)</td>" +
  16.             "<td>false && false: " + ( false && false ) +
  17.             "<br />false && true: " + ( false && true ) +
  18.             "<br />true && false: " + ( true && false ) +
  19.             "<br />true && true: " + ( true && true ) +
  20.             "</td>" );
  21.  
  22.          document.writeln(
  23.             "<tr><td width = \"25%\">Logical OR (||)</td>" +
  24.             "<td>false || false: " + ( false || false ) +
  25.             "<br />false || true: " + ( false || true ) +
  26.             "<br />true || false: " + ( true || false ) +
  27.             "<br />true || true: " + ( true || true ) +
  28.             "</td>" );
  29.  
  30.          document.writeln(
  31.             "<tr><td width = \"25%\">Logical NOT (!)</td>" +
  32.             "<td>!false: " + ( !false ) +
  33.             "<br />!true: " + ( !true ) + "</td>" );
  34.  
  35.          document.writeln( "</table>" );  
  36.          // -->
  37.       </script>
  38.  
  39.    </head><body></body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement