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 / arfu

#include<stdio.h>

int main()
{
int c,i,n;
c=0;
scanf("%d",&a);
for(i=2;i<a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)`("prime");
else printf ("not a prime");
}

Is This Answer Correct ?    110 Yes 89 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create a simple code fragment that will swap the values of two variables num1 and num2.

1327


What is the difference between mpi and openmp?

1356


Write a Program to find whether the given number or string is palindrome.

1336


Why is c called c?

1073


What are unions in c?

1083


What is an auto variable in c?

1294


Can main () be called recursively?

1175


c program to compute AREA under integral

2466


What is a pointer and how it is initialized?

1229


Is it possible to have a function as a parameter in another function?

1127


What is the use of sizeof?

1063


What are the advantages of using new operator as compared to the function malloc ()?

1406


Write a program to find factorial of a number using recursive function.

1176


Explain void pointer?

1096


code for replace tabs with equivalent number of blanks

2212