Skip to content

Instantly share code, notes, and snippets.

@deepakkhattar26o2
Created January 15, 2022 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepakkhattar26o2/1691772880055469d4cca6d8e5013f31 to your computer and use it in GitHub Desktop.
Save deepakkhattar26o2/1691772880055469d4cca6d8e5013f31 to your computer and use it in GitHub Desktop.
const readline = require("readline").createInterface({
input: process.stdin,
output: process.stdout,
});
readline.question("Enter digit: ", (num) => {
const target = String(Number(num) +1)
console.log(parseFloat(22 / 7).toPrecision(`${target}`));
readline.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment