Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is qms certification?

897


How does split work in java?

987


Tell us something about set interface.

959


Name component subclasses that support painting in java programming?

1016


Are arrays dynamic in java?

980


What is a numeric digit?

1036


What is string intern in java?

980


How hashmap increases its size in java?

934


Can java arraylist hold different types?

992


What are class types in java?

1029


How to change the priority of thread or how to set the priority of thread?

990


What are the four integer types supported by java?

982


How do you compare characters in java?

922


Why does java doesnt suuport unsigned values?

2177


How are multiple inheritances done in Java?

1092