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

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter any number:");
scanf("%d",&a);
for(b=2;b<=a-1;b++)
{
if(a%b==0)
break;
}
if(a==b)
{
printf("%d is prime number",a);
}
else
{
printf("%d is not prime number",a);
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to print data of 5 five students with structures?

2048


What is s in c?

1055


What is a memory leak? How to avoid it?

1349


What is main function in c?

1081


string reverse using recursion

2469


What are the different types of linkage exist in c?

1033


What does & mean in scanf?

1111


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

1252


What is .obj file in c?

1086


What is the process to create increment and decrement stamen in c?

1061


What is new line escape sequence?

1355


What is variable declaration and definition in c?

898


Should I learn data structures in c or python?

1026


What's the best way of making my program efficient?

1110


How will you delete a node in DLL?

1294