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

#include<stdio.h>
#include<conio.h>
{
int num,i;
printf("enter the number:");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
if(num%i==0)
{
printf("NOT PRIME");
break;
}
}
if(i==num)
{
printf("PRIME");
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you apply link and association interchangeably?

1128


Explain union. What are its advantages?

1081


Are there any problems with performing mathematical operations on different variable types?

1045


in linking some of os executables are linking name some of them

2144


What is the difference between break and continue?

1543


What are the advantages and disadvantages of pointers?

1075


What is the difference between #include

and #include “header file”?

1039


What is a good data structure to use for storing lines of text?

1089


Can the sizeof operator be used to tell the size of an array passed to a function?

1120


What is the difference between #include and #include 'file' ?

1068


What does 2n 4c mean?

1241


What does %c do in c?

1001


How can you avoid including a header more than once?

988


Explain how do you list a file’s date and time?

1043


What is a protocol in c?

1015