FACTORS OF A NUMBER
************************************************************************
W.A.P TO FIND THE FACTORS OF A NUMBER
************************************************************************
JAVA Program
Output:
************************************************************************
C Program
Online Compiler
************************************************************************
C++ Program
Online Compiler
************************************************************************
C# Program
************************************************************************
PHP Program
Php is a server side scripting language.
************************************************************************
JAVASCRIPT Program
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title>
<script type="text/javascript">
// fACTOR 12 = 1,2,3,4,6, AND 12
function check() {
var number= document.getElementById('n1').value;
var ans="";
for(var i=1; i<=number; i++)
{
if(number%i==0){
ans = ans.concat(`${i} `);
}
}
document.getElementById('ans').innerText=`Factor of ${number} are ${ans} `;
}
</script>
</head><body>
FACTOR GENERATOR
<br>
<input type="number" name="" id="n1"/>
<br>
<button onclick="check()">GENERATE</button>
<h2 id="ans" ></h2>
</body></html>
************************************************************************
PYTHON Program
************************************************************************
Comments
Post a Comment