From c3997d9bc740b06788a6798d3c181a7da333234d Mon Sep 17 00:00:00 2001 From: prashanthkp01 <31218698+prashanthkp01@users.noreply.github.com> Date: Mon, 21 Aug 2017 23:12:55 +0530 Subject: [PATCH 1/2] Create factorial.html --- factorial.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 factorial.html diff --git a/factorial.html b/factorial.html new file mode 100644 index 0000000..6996f1d --- /dev/null +++ b/factorial.html @@ -0,0 +1,25 @@ + + + + + Factorial + + + + + + + + + +Enter Number to factorial: + + + + + + + + From f7d776fa0b18bd7b4c32e55ff1e1b819858e9826 Mon Sep 17 00:00:00 2001 From: prashanthkp01 <31218698+prashanthkp01@users.noreply.github.com> Date: Thu, 24 Aug 2017 01:59:39 +0530 Subject: [PATCH 2/2] Add files via upload --- MultiOfThreeAndFive.js | 12 ++++++++++++ MultipleBuzFiz.js | 17 +++++++++++++++++ MultiplethreeBuz.html | 19 +++++++++++++++++++ SumofAnyNo.js | 13 +++++++++++++ multi.html | 19 +++++++++++++++++++ sumof.html | 19 +++++++++++++++++++ 6 files changed, 99 insertions(+) create mode 100644 MultiOfThreeAndFive.js create mode 100644 MultipleBuzFiz.js create mode 100644 MultiplethreeBuz.html create mode 100644 SumofAnyNo.js create mode 100644 multi.html create mode 100644 sumof.html diff --git a/MultiOfThreeAndFive.js b/MultiOfThreeAndFive.js new file mode 100644 index 0000000..4370051 --- /dev/null +++ b/MultiOfThreeAndFive.js @@ -0,0 +1,12 @@ +function MultipleOfInt(){ +//Find the sum of all the multiples of 3 or 5 below 1000. +var no=Number(document.getElementById("numMul").value); +var sum = 0; +for (var i = 0; i < no; i++) { + if (i % 3 === 0 || i % 5 === 0) { + sum += i; + } +} +document.getElementById("mulSet").value= sum; +console.log('Sum: %d', sum); +} \ No newline at end of file diff --git a/MultipleBuzFiz.js b/MultipleBuzFiz.js new file mode 100644 index 0000000..47db42c --- /dev/null +++ b/MultipleBuzFiz.js @@ -0,0 +1,17 @@ +function multiplesFizBuz(){ +var sum; +var no=Number(document.getElementById("numMul").value); +for (var x=1; x <= no; x++){ + if( x % 3 && x % 5 ) { + console.log(x); + } else { + if( x % 3 == 0 ) { + console.log("buzz"); + } + if( x % 5 == 0 ) { + console.log("fizz"); + } + } + +} +} \ No newline at end of file diff --git a/MultiplethreeBuz.html b/MultiplethreeBuz.html new file mode 100644 index 0000000..26d1d8f --- /dev/null +++ b/MultiplethreeBuz.html @@ -0,0 +1,19 @@ + + + + + sum of all the multiples of 3 or 5 below 1000 + + + + + +sum of all the multiples of 3 or 5 below 1000: +
+ + + + + diff --git a/SumofAnyNo.js b/SumofAnyNo.js new file mode 100644 index 0000000..7738dd4 --- /dev/null +++ b/SumofAnyNo.js @@ -0,0 +1,13 @@ + +function sumofInt(){ + //sum of first 500 natural numbers + var no=Number(document.getElementById("num").value); +var num, sum = 0; + + for (num = 1; num < no; num++) + { + sum = sum + num; + } + document.getElementById("fact").value= sum; + console.log("Sum = %4d\n", sum); +} diff --git a/multi.html b/multi.html new file mode 100644 index 0000000..65f88fe --- /dev/null +++ b/multi.html @@ -0,0 +1,19 @@ + + + + + sum of all the multiples of 3 or 5 below 1000 + + + + + +sum of all the multiples of 3 or 5 below 1000: + + + + + + diff --git a/sumof.html b/sumof.html new file mode 100644 index 0000000..e20222e --- /dev/null +++ b/sumof.html @@ -0,0 +1,19 @@ + + + + + sum of first 500 number + + + + + +sum of first 500 number: + + + + + +