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

Do you know the purpose of 'register' keyword?

1023


Why array is used in c?

1026


In c programming language, how many parameters can be passed to a function ?

1119


What are c header files?

999


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

1105


Explain what does the function toupper() do?

1083


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2243


How do you list files in a directory?

1149


What is the heap in c?

1085


How can you access memory located at a certain address?

1123


What are keywords c?

1035


What is the difference between a string and an array?

1215


How do you print only part of a string?

1023


Where are some collections of useful code fragments and examples?

1164


How do I get an accurate error status return from system on ms-dos?

1133