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

How do I read the arrow keys? What about function keys?

1018


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1035


Is stack a keyword in c?

1038


Differentiate between declaring a variable and defining a variable?

995


What is time complexity c?

941


What is the heap?

1155


What is an example of structure?

981


Which is the memory area not included in C program? give the reason

1897


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

983


what is bit rate & baud rate? plz give wave forms

1914


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

1052


Which is better malloc or calloc?

1059


Do string constants represent numerical values?

1323


What are operators in c?

962


What is return in c programming?

917