Advertisement
RokiAdhytama

Increment - Chapter 8

Jul 2nd, 2022
1,001
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>Preincrementing and Postincrementing</title>
  4.  
  5.       <script type = "text/javascript">
  6.          <!--
  7.          var c;
  8.    
  9.          c = 5;
  10.          document.writeln( "<h3>Postincrementing</h3>" );
  11.          document.writeln( c );              // print 5
  12.          // print 5 then increment
  13.          document.writeln( "<br />" + c++ );
  14.          document.writeln( "<br />" + c );   // print 6
  15.  
  16.          c = 5;
  17.          document.writeln( "<h3>Preincrementing</h3>" );
  18.          document.writeln( c );              // print 5
  19.          // increment then print 6
  20.          document.writeln( "<br />" + ++c );
  21.          document.writeln( "<br />" + c );   // print 6
  22.          // -->
  23.       </script>
  24.  
  25.    </head><body></body>
  26. </html>
Advertisement
RAW Paste Data Copied
Advertisement