answersLogoWhite

0

You can use the symbol % to see the remainder of the division problem. eg. document.write(11 % 3 + "") will display the number 2 since 3 goes into 11 three times with a remainder of 2.

So here's some sample code:

function oddEven(num){

if(num % 2 == 0){

return "even"

}

else{

return "odd"

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How can i write ducci's game in java script?

You just can't.


Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


What is used to create large program on internet?

Java script


What program code is the easiest to learn?

Most likely java script


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


How do you write javascript codes for website on a mac?

You can write java script code on any platform be it mac, linux, solaris or windows. All you need is a mac version of notepad, some html page where you insert your java script code and a web browser where you view the html page. All major browsers support java script coding and all you need to do is enable the Java Script support in browsers if it is not enabled already.


What is javadoc?

write a java program to display "Welcome Java" and list its execution steps.


How write new line program in java?

\n


What is java fx2.1.1?

Java script


Is Java script needed for Poptropica?

No, Java script is not needed to play poptropica.


What are good Java script codes?

depending on the intention of the javascript codes you wish to write. there is much you can do with javascript but the only way to find out what "good Java script codes" are is to explore what you want the Javascript to do on the page.