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 / felix c. intelegando

#include<stdio.h>
#include<conio.h>


int main(void)
{
int i,n,count=0;
printf("Enter Number: ");
scanf("%d",&n);
for(i=2;i<n;i++)

{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("Not Prime ");

}
else
printf("Prime");

getch();
return 0;
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is indirection? How many levels of pointers can you have?

1206


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1224


Is array name a pointer?

1077


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1169


What is the difference between call by value and call by reference in c?

1212


What is scope rule of function in c?

1149


What is wrong with this program statement? void = 10;

1312


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3147


The difference between printf and fprintf is ?

1344


How can I generate floating-point random numbers?

1203


What is property type c?

1135


How reliable are floating-point comparisons?

1150


Explain Function Pointer?

1242


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2021


Explain how can I open a file so that other programs can update it at the same time?

1182