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 / pritam neogi

#include<stdio.h>
#include<conio.h>
void main()
{
int no,i;
clrscr();
printf(" Enter the Number U want to check:");
scanf("%d",&no);
i=2;
while(i<=no-1)
{
if(no%i==0)
{
printf(" %d is not Prime number",no );
// break;
}
i=i+1;
}
if(no==i)
printf("%d is a prime Number",no);
getch();
}

Is This Answer Correct ?    24 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2076


Explain do array subscripts always start with zero?

1242


How do I get a null pointer in my programs?

1119


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1151


What is equivalent to ++i+++j?

1097


how can I convert a string to a number?

1086


How do I copy files?

1066


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1091


What is strcmp in c?

1133


What are the uses of null pointers?

1130


Why is event driven programming or procedural programming, better within specific scenario?

2441


What is structure in c definition?

1059


How do you use a pointer to a function?

1093


When can a far pointer be used?

1035


Explain the use of 'auto' keyword

1125