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

Who is the main contributor in designing the c language after dennis ritchie?

1052


Why ca not I do something like this?

1064


What is malloc calloc and realloc in c?

1425


What are shell structures used for?

1095


Explain how do you determine the length of a string value that was stored in a variable?

1197


What is 2 d array in c?

1087


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1127


How can I open files mentioned on the command line, and parse option flags?

1104


What is c language & why it is used?

1174


What is bubble sort in c?

1104


What does the format %10.2 mean when included in a printf statement?

1708


Why is this loop always executing once?

1110


Why & is used in c?

1247


What are control structures? What are the different types?

1142


What are types of structure?

1171