0% found this document useful (0 votes)
5 views1 page

Print Odd Numbers in JavaScript

The document provides a JavaScript program that defines a function to print odd numbers between 10 and 100. The function uses a for loop to iterate through the specified range and checks if a number is odd using the modulus operator. Finally, the function is called to execute and display the odd numbers in the console.

Uploaded by

cshinde000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Print Odd Numbers in JavaScript

The document provides a JavaScript program that defines a function to print odd numbers between 10 and 100. The function uses a for loop to iterate through the specified range and checks if a number is odd using the modulus operator. Finally, the function is called to execute and display the odd numbers in the console.

Uploaded by

cshinde000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

• Create a JavaScript program to print odd numbers from 10 to 100


// Function to print odd numbers from 10 to 100
function printOddNumbers(start, end) {
for (let i = start; i <= end; i++) {
if (i % 2 !== 0) {
[Link](i);
}
}
}

// Call the function to print odd numbers from 10 to 100


printOddNumbers(10, 100);

You might also like