Q ?write an application that print out the even numbers between the range 100-200 ? 1- which aer not divisible by 7 and 5 ? 2- Number of the numbers which are not divisible by 7 and 5? 3- The summation of the numbers?

View Answers

May 14, 2012 at 12:23 PM

**The given code prints out the even numbers between the range of 100 and 200 and then determine the even numbers which are not divisible by 5 and 7. It also find out the sum of all the even numbers between 100 and 200.**

class EvenNumbers { public static void main(String[] args) { int sum=0; System.out.println("Even Numbers between 100 and 200"); for(int i=100;i<=200;i++){ if(i%2==0){ sum+=i; System.out.println(i); } } System.out.println("Even Numbers between 100 and 200 which are not divisible by 5 and 7"); for(int i=100;i<=200;i++){ if(i%2==0){ if((i%7!=0)&&(i%5!=0)){ System.out.println(i); } } } System.out.println("Sum of even numbers: "+sum); } }

Ads

Related Tutorials/Questions & Answers:

print the even numbers between the range 100-200 Q ?write an application that print out the even numbers between the range 100-200 ? 1- which aer... prints out the even numbers between the range of 100 and 200 and then determine

write an application that print out the even numbers between the range 100-200 write an application that print out the even numbers between... and determine the even numbers between them. class EvenNumbers { public static

Advertisements

Listing all even numbers between two numbers Hi, How to write code to list all the even numbers between two given numbers? Thanks Hi, You function will take 2 numbers and the find the even numbers between

How to list even numbers between 1 and 100? Hi, I Java to check if a number is even? How to list even numbers between 1 and 100? Thanks ...: if(i%2==0 ){ //Number is even } You can use the for loop and print all

Program to display palindrome numbers between some range Hi!I want a java program to display palindrome numbers between 100 to 1000.can you please explain me the logic with an example import java.util.*; public

Write a program to list all even numbers between two numbers... all the even numbers between two numbers. For this first create a class named... all even numbers between 1 and this numbers. Here is the code

Generating random numbers in a range with Java Generating random numbers in a range with Java

Prime Numbers from range how to find prime numbers in a given range which are palindromes?? Hi Friend, Try the following code: import java.util.*; public class PrimeAndPalindrome { static final int MAXNUMBER

Application for print pyramid of numbers What is the code for printing the numbers like 1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1

ModuleNotFoundError: No module named 'print_range' Hi, My Python... 'print_range' How to remove the ModuleNotFoundError: No module named 'print_range' error? Thanks Hi, In your python environment

print numbers in traingle shape 1 22 333 4444 i want output like this please help me class Pyramid { public static void main(String[] args) { for(int i=1;i<=4;i++){ for(int j=1;j<

print the sum of even number from 1 to 100 how to print the sum of even number from 1 to 100 using for loops? Thanks

mysql difference between two numbers How to get total bate difference between two dates for example 1/01/2012 and 1/02/2012 in MYSQL? ... between two date. The syntax of DATEDIFF is .. SELECT DATEDIFF('2012-01-31 23:59

Prime numbers in Java between 1 and 100 Hi, How to display prime numbers in java between 1 and 100? Thanks Hi, Prime numbers... which prints prime numbers between 1 and 100. Here is complete for printing prime

Generate random number between two numbers in Scala Hi, How to Generate random number between two numbers in Scala? Thanks Hi, Following code can be used for generating random number in scala: val rand = new

Generate random number between two numbers in Scala Hi, How to Generate random number between two numbers in Scala? Thanks Hi, Following code can be used for generating random number in scala: val rand = new

How to print a equilateral triangle patren with numbers I figure out how to use for loop to print the triangle but i couldn't get the exact values as this http://im37.gulfup.com/FzrOb.jpg could you please help me

how to write a program in java to print numbers in equalateral triangle the output must be 1 324 76589 Here is an example of pattern 1 2 3 4 5 6 7 8 9 Example: public class NumberTriangle{ public

java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement hi class Even{ public static void main(String[] arg){ int num=Integer.parseInt

is used for inputting number. Even numbers are those numbers, which are divisible... the condition of num divisibility. If divisible then it will print even number else...Check even or odd number. How to check given number is even or odd

the automorphic numbers between 1 and 1000. Automorphic numbers are the numbers... of number 6 at the end. Here we are going to find the automorphic numbers between 1...("Automorphic Numbers between 1 and 1000 are: "); for (long i = 1; i < 1000; i

SQL BETWEEN Operator The SQL Between Operator works where you want to select a range of data between two values. In SQL, the BETWEEN operator is used to select a range

print How to print JFrame All Componant? Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml

"); } } } Description : Number which is divisible by 2 is called even numbers...Even and odd functions in java Even and odd functions in java ...); int number; System.out.println("Input any number to check even

Mysql Time Range ... numbers. Understand with Example The Tutorial illustrate an example from 'Mysql Time Range'. To understand example we create a table 'timetable' with fields

range of dates in mysql query How to select the range of dates in mysql ..when i have to select from between & and of date function? SELECT * FROM MAAccounts WHERE updatedOn BETWEEN ? AND ? ORDER

these arguments and print the addition of those numbers. In this example, args... Add Two Numbers in Java .... These passed arguments are of String types so these can't be added as numbers

sorting numbers How to sort the numbers in ascending order import java.util.*; class SortNumbers{ public static void main(String...=input.nextInt(); list.add(num); } System.out.println("Numbers

Prime Numbers Create a complete Java program that allows the user to enter a positive integer n, and which then creates and populates an int array with the first n prime numbers. Your program should then display the contents

random numbers Hi I need some help with the code for the this program. This program should randomly choose a number between 1 and 1000... the computer has randomly chosen the number 759.] Guess my number! It's between 1 and 1000

Numbers pyramid Hi sir, Can you please tell me how to output this using nested for loops? 1 2, 1 1, 2, 3 4, 3, 2, 1 1, 2, 3, 4, 5 6, 5, 4, 3, 2, 1 1, 2, 3, 4, 5, 6, 7 8, 7, 6, 5, 4, 3, 2, 1 1, 2, 3, 4, 5, 6, 7, 8, 9 10, 9, 8

Rational Numbers Write and fully test a class that represents rational numbers. A rational number can be represented as the ratio of two integer values, a and b, where b is not zero. The class has attributes for the numerator

mysql between dates not between dates I am trying to list the data between dates and not between dates using join method ..but that not working for me

ModuleNotFoundError: No module named 'range' Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'range' How to remove the ModuleNotFoundError: No module named 'range'

MySQL range May... in the particular range of values but there is not any predefined function in MySQL but we can also find that particular range's data from the database in MySQL using

ModuleNotFoundError: No module named 'even-tester' Hi, My Python... 'even-tester' How to remove the ModuleNotFoundError: No module named 'even-tester' error? Thanks Hi, In your python environment

ModuleNotFoundError: No module named 'even_detector' Hi, My... 'even_detector' How to remove the ModuleNotFoundError: No module named 'even_detector' error? Thanks Hi, In your python

ModuleNotFoundError: No module named 'even_detector' Hi, My... 'even_detector' How to remove the ModuleNotFoundError: No module named 'even_detector' error? Thanks Hi, In your python

Hexadecimal numbers multiplication Sir, I have to multiply 128 bit hexadecimal numbers. Do u have any logic for this?? The numbers are like ab7564fa342b5412c34d9e67ab341b58

ModuleNotFoundError: No module named 'numbers' Hi, My Python... 'numbers' How to remove the ModuleNotFoundError: No module named 'numbers... to install padas library. You can install numbers python with following command

multiply of 100 digits numbers multiplying 100 digits numbers to eachother

read a positive real numbers from highest to lowest write a java program that will read a sequence of 10 positive real nos. entered by the user and will print the same numbers in sorted order from lowest to highest using arrays

SQL BETWEEN Operator The SQL Between Operator works where you want to select a range of data between two values. In SQL, the BETWEEN operator is used to select a range

ModuleNotFoundError: No module named 'print_print' Hi, My Python... 'print_print' How to remove the ModuleNotFoundError: No module named 'print_print' error? Thanks Hi, In your python environment