Skip to content

hacimertgokhan/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Project

In that project, I did a simple calculator can do Sqrt, Any power of number, And factorial stuff.

Some methods

Factorial


    // Factorial
    const number = result.innerHTML;
     let a = 1;
    for(let i = 1; i<=number; i++) {
        a = (a*i);
    }
    result.innerHTML = `${a}`;

Power of Number


    // Pofn
    let a = prompt('What power of the number do you want to get?');
    let num = Number(a);
    let b = Math.pow(result.innerHTML, num);
    result.innerHTML = `${b}`;

Sqrt


    // Sqrt
    const problem = result.innerHTML;
    let a = Math.pow(problem, 2);
    result.innerHTML = `${a}`;

Image(s)

resim_2023-10-21_104132148

Forks

Developed by CParthur1