Program to find greatest prime number in n numbers?
Answer Posted / rajani nagandla
1.Read n
2.lets take variables of type int (i=1,j=1,temp=0,count=0);
3. for (;i<n;i++){
count=0;
while(j<=i){
if((i%j)==0){
count+=1;
j++;
if(count>2)break;
}
}
if(count==2)
temp=i;
}
4.the value in temp after for loop execution will be the
Greatest Prime Number
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is qms certification?
How does split work in java?
Tell us something about set interface.
Name component subclasses that support painting in java programming?
Are arrays dynamic in java?
What is a numeric digit?
What is string intern in java?
How hashmap increases its size in java?
Can java arraylist hold different types?
What are class types in java?
How to change the priority of thread or how to set the priority of thread?
What are the four integer types supported by java?
How do you compare characters in java?
Why does java doesnt suuport unsigned values?
How are multiple inheritances done in Java?