From d3415a58886d013a36deec0b8413bdb0636aa678 Mon Sep 17 00:00:00 2001 From: pawan456 Date: Tue, 19 Oct 2021 14:14:13 +0500 Subject: [PATCH] Added some js programs --- AirthmaticOperators.js | 10 ++++++++++ HalfPyramid.js | 14 ++++++++++++++ HelloWorld.js | 1 + 3 files changed, 25 insertions(+) create mode 100644 AirthmaticOperators.js create mode 100644 HalfPyramid.js create mode 100644 HelloWorld.js diff --git a/AirthmaticOperators.js b/AirthmaticOperators.js new file mode 100644 index 0000000..c6d5633 --- /dev/null +++ b/AirthmaticOperators.js @@ -0,0 +1,10 @@ +let x=5; +let y=4; +let sum=x+y; +let product=x*y; +let division=x/y; +let subs=x-y; +console.log("Sum is =",sum); +console.log("Substraction is =",subs); +console.log("Multiplication is =",product); +console.log("Division is =",division); \ No newline at end of file diff --git a/HalfPyramid.js b/HalfPyramid.js new file mode 100644 index 0000000..6db6f6e --- /dev/null +++ b/HalfPyramid.js @@ -0,0 +1,14 @@ +function createHalfPyramid (height) { + + for (var i = 1; i <= height; i++) { + var row = ''; + + for (var j = 1; j <= i; j++) { + row += '*'; + } + + console.log(row); + } +} + +createHalfPyramid(5); \ No newline at end of file diff --git a/HelloWorld.js b/HelloWorld.js new file mode 100644 index 0000000..ae9e3a9 --- /dev/null +++ b/HelloWorld.js @@ -0,0 +1 @@ +console.log("Hello, World!"); \ No newline at end of file