FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 548   



Demo

Code

<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
    </script>

    <script>
        $(document).ready(function() {
            $("#answer").click(function() {
                var n = $("#number").val();

                $("#result").val((+n) * ((+n) + (1)) / (2))
            });

        });
    </script>

</head>

<body>

    <div>
        Enter your factorial number:
        <input type="text" id="number"><br><br>

        <button type="button" id="answer">Answer</button><br><br> Result:
        <input type="text" id="result">


    </div>
</body>

</html>



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News