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 / oza priyanka

#include<stdio.h>
void main()
{
int num,i,cnt;
clrscr();
printf("\n\nEnter the number = ");
scanf("%d",&num);
for(i=2,cnt=0;i<num;i++)
{
if(num%i==0)
cnt=1;
}
if(cnt==0)
printf("\n\nprime number");
else
printf("\n\n not a prime number");
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any possibility to create customized header file with c programming language?

1065


Explain what is gets() function?

1075


What are header files in c programming?

1129


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

1190


What is c language and why we use it?

1070


What are header files? What are their uses?

1210


What is the process of writing the null pointer?

1026


Why can’t we compare structures?

1269


What is the difference between typedef and #define?

1057


Why is c so important?

1060


What is the difference between struct and typedef struct in c?

1126


What is a program flowchart and how does it help in writing a program?

1139


Explain what are run-time errors?

1086


How main function is called in c?

1123


What is malloc() function?

1156