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 / noble

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter any number:");
scanf("%d",&a);
for(b=2;b<=a-1;b++)
{
if(a%b==0)
break;
}
if(a==b)
{
printf("%d is prime number",a);
}
else
{
printf("%d is not prime number",a);
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s the special use of UNIONS?

1205


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1321


How do you generate random numbers in C?

1246


difference between native and cross compilers

2171


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1326


Why & is used in scanf in c?

1146


What is a shell structure examples?

1148


how to create duplicate link list using C???

2603


What is pointers in c?

1164


Who invented bcpl language?

1247


How do you override a defined macro?

1315


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1170


What are the advantages of c language?

1149


Why is extern used in c?

1145


Can I initialize unions?

1090