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 is the condition that is applied with ?: Operator?

1185


What is the difference between far and near ?

1244


Explain what are its uses in c programming?

1126


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1175


What header files do I need in order to define the standard library functions I use?

1120


What are the properties of union in c?

1111


What are the types of c language?

1080


Calculate 1*2*3*____*n using recursive function??

2099


Explain void pointer?

1096


What is use of #include in c?

1220


How can I implement sets or arrays of bits?

1092


Tell me with an example the self-referential structure?

1079


What is the use of static variable in c?

1142


What is adt in c programming?

1225


What is volatile variable in c?

1155