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...

write the program for prime numbers?

Answer Posted / mudassir shakil

using System;
class Prime_Checker
{
int i;
int counter=0;
int n;
Console.WriteLine("Enter the number");
n=int.Parse(Console.ReadLine());
for(i=2;i<=n;i++)
{
if(n%i==0)
{
counter=1;
}
if(counter=0)
{
Console.WriteLine("No is prime");
}
else
{
Console.WriteLine("No is not prime");
}
}
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1188


How do you convert strings to numbers in C?

1294


what is the syallabus of computer science students in group- 1?

2368


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1099


Why c is called procedure oriented language?

1105


Explain the difference between malloc() and calloc() function?

1100


what is use of malloc and calloc?

1951


Explain enumerated types in c language?

1103


Why c is procedure oriented?

1122


Tell me what is null pointer in c?

1127


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

2043


How many levels of indirection in pointers can you have in a single declaration?

1142


What is the benefit of using const for declaring constants?

1102


Tell me what are bitwise shift operators?

1172


Between macros and functions,which is better to use and why?

2316