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

how is the examination pattern?

1964


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

986


c program to compute AREA under integral

2336


Write a program to print fibonacci series without using recursion?

1065


Why should I prototype a function?

1120


What is the correct code to have following output in c using nested for loop?

1027


Explain the term printf() and scanf() used in c language?

999


Explain how do you use a pointer to a function?

1053


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1147


Write a program to print factorial of given number without using recursion?

950


How pointers are declared?

907


What is null pointer in c?

947


Define macros.

1222


What are different storage class specifiers in c?

1042


write a c program in such a way that if we enter the today date the output should be next day's date.

2136