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

Which of these functions is safer to use : fgets(), gets()? Why?

1162


What is the difference between malloc() and calloc()?

1980


What is a stream water?

1282


Are there any problems with performing mathematical operations on different variable types?

1104


What is the scope of local variable in c?

1201


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

2085


Explain what are header files and explain what are its uses in c programming?

1201


What do you mean by command line argument?

1227


what are the facialities provided by you after the selection of the student.

2331


What is the importance of c in your views?

1237


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

2139


int far *near * p; means

3621


Explain can you assign a different address to an array tag?

1122


When is a null pointer used?

1169


What is a double c?

1041