daily pastebin goal
71%
SHARE
TWEET

triangle

a guest Apr 22nd, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. index.html
  2. --------------------------------
  3. <!doctype html>
  4. <html>
  5.  
  6.     <head>
  7.    
  8.         <script src="javascript.js"></script>
  9.                    
  10.    
  11.     </head>
  12.    
  13.     <body>
  14.        
  15.        
  16.     </body>
  17.  
  18. </html>
  19. --------------------------------
  20.  
  21.  
  22. javascript.js
  23. --------------------------------------
  24.  
  25. var st = "";
  26. var num = prompt("enter a whole number");
  27.  
  28.  
  29.  
  30. for(var i=1; i<=num; i+=1){
  31.    
  32.     for(var j=0; j<num-i; j+=1){
  33.         st+="&nbsp;&nbsp;";
  34.     }
  35.    
  36.     for(var k=0; k<2*i-1; k+=1){
  37.         st+="*";
  38.     }
  39.    
  40.     st+="<br/>";
  41.    
  42. }
  43.  
  44. document.write(st);
  45. --------------------------------------
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top