Community Sites
Create your own community website and start earning today !
It's Free !
Forum
Resources
Mentors
Projects
Entrance Exams
Question Papers
Colleges
Courses
Universities
Schools
Make Money
Communities
Members
Bookmarks
Polls
Fresher Jobs
Funny Photos
B.Tech Projects
New Member FAQ
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
eldho
(40)
mayur tiwary
(30)
narendra
(15)
Last 7 Days
sunil
(2114)
Saagar
(1696)
satish
(1423)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
JAVA code to find prime numbers in the array
Posted Date: 15 Aug 2008 Resource Type:
Articles/Knowledge Sharing
Category:
Computer & Technology
Posted By:
Rahul Jain
Member Level:
Gold
Rating:
Points
: 2
import java.util.Scanner;
class arrays4
{
public static void main (String args[])
{
Scanner o=new Scanner(System.in);
int a[]=new int[10];
int b=0,t=0,p=0;
System.out.println("Enter the array :");
for (int i=0;i<10;i++)
{
a[i]=o.nextInt();
}
for(int l=0;l<10;l++)
{
if (a[l]==1 && a[l]==2)
{
b++;
continue;
}
else
{
int f=a[l];
for(int m=2;m
{
int k=f%m;
if (k==0)
{
t++;
}
}
if(t==0)
{
b++;
}
}
}
System.out.println("no of prime numbers in the array:"+b);
}
}
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
Prime nos.
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
JAVA code to store 1 to 10 then 10 to 1
Previous Resource:
JAVA code to find the average marks
Return to Discussion Resource Index
Post New Resource
Category:
Computer & Technology
Post resources and
earn money
!
Related Resources
Bar code scanner
Print a semicolon without using semicolon in the Program
Hidden programs in windows XP
Word
Arithmetic Calculations
Watch TV Channels
Watch Asianet online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Contact Us
Editors
Privacy Policy
Terms Of Use
SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.