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 / sachin 12

#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2,f=0,j;
printf("\n enter any number");
scanf("%d",&num);
a=num;
while(i<num)
{
if(num%i==0)
{
f=1
break;
}
i++;
}
if(f==i)
{
printf("\n the number is not prime");
}
else
{
printf(""\n the number is prime");
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of type specifiers?

1035


What is define c?

1073


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1069


What is local and global variable in c?

1196


What are the types of pointers in c?

1024


Differentiate between declaring a variable and defining a variable?

1038


Explain what are reserved words?

1103


Explain what is the difference between far and near ?

1104


What tq means in chat?

1122


Why is %d used in c?

1005


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1245


What is string constants?

1147


What is difference between union All statement and Union?

1105


Explain what happens if you free a pointer twice?

1076


What is the benefit of using an enum rather than a #define constant?

1235