1function evenOrOdd(num) { //for string length take string
2 if (num % 2 == 0) {//and replace numm with string.length here
3 return "even";
4 } else {
5 return "odd";
6 }
7}
1for(let count =0; count<=100;count++){
2 count%2==0? console.log(`${count} is even`):console.log(`${count} is odd`);
3 ;
4}
1<!doctype html>
2<html>
3<head>
4<script>
5function odd_even(){
6var no;
7no=Number(document.getElementById("no_input").value);
8if(no%2==0)
9{
10alert("Even Number");
11}
12else
13{
14alert("Odd Number");
15}
16}
17</script>
18</head>
19<body>
20Enter Any Number:<input id="no_input"><br />
21<button onclick="odd_even()">Click me</button>
22</body>
23</html>