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 / ashwini kumar nayak

#include<stdio.h>
#include<conio.h>

void main()
{
clrscr();
int c,i,n;
c=0;
printf("Enter the number");
scanf("%d",&n);
if(n==1)
printf("Number is the special number");
else
{
for(i=2;i<n;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)
printf("prime");
else
printf ("not a prime");
}
getch();

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we access array using pointer in c language?

1096


What is chain pointer in c?

1066


which type of aspect you want from the student.

2167


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3584


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

1184


How arrays can be passed to a user defined function

1025


What is call by reference in functions?

1457


What is uint8 in c?

1106


Where static variables are stored in c?

1112


What is the difference between procedural and declarative language?

1147


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1162


What is atoi and atof in c?

1088


How can I write functions that take a variable number of arguments?

1130


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1081


How can I call a function with an argument list built up at run time?

1248