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

What is the code for 3 questions and answer check in VisualBasic.Net?

2163


What is %d used for?

1042


What is typedf?

1127


Is c is a middle level language?

1070


What are the features of the c language?

1088


How can I manipulate individual bits?

1043


What is union and structure?

1127


Explain what is the difference between functions abs() and fabs()?

1187


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

1005


Is c object oriented?

974


What are the differences between Structures and Arrays?

1216


How do you construct an increment statement or decrement statement in C?

1238


What is ctrl c called?

1053


What is a #include preprocessor?

1161


Which is the best website to learn c programming?

1082