1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tester [92]
3 years ago
5

Using Module operator, write a java program to print odd number between 0 and 1000​

Computers and Technology
1 answer:
jolli1 [7]3 years ago
5 0

Answer:

class OddNumber

{

  public static void main(String args[])  

       {

         int n = 1000;  //Store 1000 in Variable n typed integer

         System.out.print("Odd Numbers from 1 to 1000 are:");  // Print headline of output window

         for (int i = 1; i <= n; i++)  //For loop to go through each number till end

          {

            if (i % 2 != 0)  //check if number is even or odd.Not divisible by 2 without reminder means it is odd number

             {

               System.out.print(i + " "); //print odd numbers

             }

          }

       }

}              

You might be interested in
When spraying pesticide wear and protective eyeglass​
exis [7]
Ummmmmmmmmmmmmmmmmmmmm ok
6 0
2 years ago
Read 2 more answers
A restaurant is a workplace for someone whose career specialty is in
Rashid [163]
A restaurant is a workplace for someone whos career specialty is in... Cooking

The answer is: Cooking
3 0
3 years ago
Read 2 more answers
Maggie is preparing a business report. Which types of keys will she use to type out words and numbers?
nadya68 [22]
She would use enter period comma backspace
Hope this helps u
6 0
3 years ago
Read 2 more answers
9.18 lab: even/odd values in a vector write a program that reads a list of integers, and outputs whether the list contains all e
lana66690 [7]

def is_list_even(my_list):

   for i in my_list:

       if(i%2 != 0):

           return False

   

   return True

   

   

def is_list_odd(my_list):

   for i in my_list:

       if(i%2 == 0):

           return False

   

   return True

   

def main():

   n = int(input())

   lst = []

   

   for i in range(n):

       lst.append(int(input()))

   

   if(is_list_even(lst)):

       print('all even')

   

   elif(is_list_odd(lst)):

       print('all odd')

   

   else:

       print('not even or odd')

       

       

if __name__ == '__main__':

   main()

6 0
2 years ago
PLEASE I NEED HELP PLEASE PLEASE<br> Which function prompts the user to enter information?
Stels [109]

In python the input() function prompts the user to enter information.

5 0
3 years ago
Other questions:
  • Many malware attacks are ____ attacks, which involve more than one type of malware and/or more than one type of transmission met
    6·1 answer
  • A typical serial cable has
    13·1 answer
  • Which of the following statements is true of intrapreneurs
    15·1 answer
  • A list of pages within a Web site that you have visited and that usually appears at the top of a page is referred to as a(n) ___
    14·1 answer
  • Spoken word and written word are different because what
    9·1 answer
  • Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fe
    13·1 answer
  • Please help. 15 points!!!!
    8·2 answers
  • Which technology has the potential to be misused to make atomic bombs? A. computer technology B. nuclear technology C. medical t
    14·1 answer
  • What would be used by a business to assess how the business is working within its organization goals? O A. Information systems B
    8·1 answer
  • Write a complete program that declares an integer variable
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!