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 / vijay bharti

#include<stdio.h>
#include<conio.h>

void main()
{
int num,i,count=0;
clrscr();
for(num=1;num<=300;num++)
{
for(i=2;i<=num/2;i++)
{
if(num%i!=0)
count=count+1;
}

}

printf("number of prime numbers between 1 to 300 are : %d",count);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2255


How can you call a function, given its name as a string?

1116


What is the use of bitwise operator?

1080


Why do we write return 0 in c?

1014


What is cohesion in c?

931


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1027


What is the default value of local and global variables in c?

999


What is #define in c?

999


What are register variables? What are the advantage of using register variables?

1143


Explain can static variables be declared in a header file?

1121


What is use of integral promotions in c?

1092


Explain what is the benefit of using const for declaring constants?

980


What is const and volatile in c?

1001


What is the general form of a C program?

984


What is c standard library?

1159