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 / shubhanshu pandey

main()
{
int a,c=0,i,n;
printf("enter the number to be checked");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=n%i;
if(a=0)
{
c=c+1;
}
}
if (c=2)
{ printf("the given number is prime"); }
else
printf("the given number is not prime");
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain modulus operator.

1017


number of times a digit is present in a number

2004


What are register variables in c?

987


How main function is called in c?

1091


why wipro wase

2269


How is a pointer variable declared?

1041


What is the use of a static variable in c?

1027


What are the various types of control structures in programming?

1026


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

1076


What is the difference between array and pointer?

979


Can you return null in c?

1114


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

968


How pointers are declared?

925


List some applications of c programming language?

920


How can I recover the file name given an open stream or file descriptor?

1046