Skip to content

VictorNjeru49/question_three-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

question_three-

<title>Document</title> <script language="javascript">
      /*Question 3: Power of Two
  Write a program that takes an integer as input and returns true if the input is a power of two.
  Examples: 
  8=> returns true
  6=> returns false*/ 

function divisiblity(){
  var a =prompt('Enter a number');
  var results;

  if (a%2===0){
    results='a divisible of 2';
    alert('true')
  }
  else{
    results='not a divisible of 2';
    alert('false')
  }
  document.write(results);
}
</script> calculate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published