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

provide an example of the Group by clause, when would you use this clause

2155


Is it fine to write void main () or main () in c?

987


What is c programing language?

1060


about c language

1978


Explain how can I convert a string to a number?

1046


How can I run c program?

1141


Explain what are run-time errors?

1056


What is meant by recursion?

1020


What is %d called in c?

1196


What are two dimensional arrays alternatively called as?

1152


Differentiate fundamental data types and derived data types in C.

999


Do you know the purpose of 'register' keyword?

984


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

1038


What are 3 types of structures?

1039


Is null always defined as 0(zero)?

1068