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 a program to find the given number is prime or not

Answer Posted / rabindra nath das

#include<stdio.h>
#include<conio.h>
void main()
int n,k,fl=0,r;
clrscr();
printf("\n Enter the number==>>");
scanf("%d",&d);
for(k=2;k<=n/2 && fl==0;k++)
{
r=n%k;
if(r==0);
fl=1;
}
if(fl==0)
printf("\n %d is a prime number",n);
else
printf("\n %d is not prime number",n);
getch();
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the rules for the identifier?

1158


How can I get random integers in a certain range?

1065


Is c++ based on c?

1070


Differentiate between a for loop and a while loop? What are it uses?

1177


What is the scope of static variable in c?

1021


What are the different data types in C?

1201


What is void pointers in c?

1005


What are the features of the c language?

1084


what is bit rate & baud rate? plz give wave forms

1978


Why c is faster than c++?

1030


What are the different types of control structures in programming?

1128


How are 16- and 32-bit numbers stored?

1289


What does %c mean in c?

1086


When can you use a pointer with a function?

1066


What is the purpose of realloc()?

1139