Write a java application program........?

Write a java application program........?

Welcome every One : I have Q in Java?

Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers less than 100?

thanks

View Answers

April 24, 2012 at 11:37 AM

import java.util.*;

class NumberExample 
{
    public static void main(String[] args) 
    {
        int count1=0;
        int count2=0;
        Scanner input=new Scanner(System.in);
        System.out.println("Enter 20 numbers:");
        int i=1;
        while(i<=20){
            int num=input.nextInt();
            if(num>100){
             count1++;
            }
            else if(num<100){
            count2++;
            }
            i++;
        }
            System.out.println(count1+" numbers are greater than 100");
            System.out.println(count2+" numbers are smaller than 100");
    }
}









Related Tutorials/Questions & Answers:
Write a java application program........?
Write a GUI application for the WebBuy Company
Advertisements
write a program for complete JDBC based application
Hire developers to write an iPhone Android application
write a java program
How to write Java Program
How to write in File in Java
write a programm using java
write java prgram
how a write a server side progranming in j2sdk for j2me application
pls provide steps to write ejb3.0 simple application in eclipse - EJB
Java write to file
How to write Example code for CRUD application in hibernate annotation?
write an application that print out the even numbers between the range 100-200
write the java program?
write the java program?
Write java program?
Write java program?
How to write in File in Java
How to Write to file in Java?
Write a program in java...
help to write java code
help to write java code
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA
write program - Java Beginners
Write short note on Java package.
write a program - Java Beginners
write a program in java.
Java Stream Write Exception
How to Write To File BufferedWriter in Java
how to write java data - XML
How to write file by line in Java
how to write append file in Java
How to write to xml file in Java?
How to write into CSV file in Java
Java Write to File
Write a java pregram: Help with methods
CREATE AND WRITE FILE THREAD JAVA
Java file read write operation
How to write a simple java applet
Write a Java applet to draw cylinder and pentagon shapes.
Developing JSP, Java and Configuration for Hello World Application
read/write to Windows Registry using Java
Java Application
how to write this program? - Java Beginners
Java Write To File - Java Tutorial
how to write the program - Java Beginners
Java application - Java Beginners
write a program in java to read a text file and write the output to an excel file using filereader and filewriter?

Ads