Created
July 17, 2012 18:12
-
-
Save calvinf/3130954 to your computer and use it in GitHub Desktop.
Multiplication Table in node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'), | |
sprintf = require('sprintf').sprintf, // npm install sprintf | |
rows = 10 | |
for(var i=1;i<=rows;i++) { | |
for(var j=1;j<=rows;j++) { | |
var num = sprintf('%3d', i * j) | |
process.stdout.write(num + " ") | |
} | |
process.stdout.write("\n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment