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

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i;
printf("enrer the value");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime");
break;
}
i++;
}
if(i==num)
printf("prime");
getch();

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you access memory located at a certain address?

1121


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2255


What is the benefit of using #define to declare a constant?

1095


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2680


I heard that you have to include stdio.h before calling printf. Why?

1067


Explain what is dynamic data structure?

1169


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1765


Explain what are the different file extensions involved when programming in c?

1111


Can a variable be both static and volatile in c?

1042


what is the different bitween abap and abap-hr?

2332


What are dangling pointers? How are dangling pointers different from memory leaks?

1317


What are enumerated types?

1194


In which header file is the null macro defined?

1346


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1025


What are pointers? Why are they used?

1183