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 / farhana parvin sunny

#include<stdio.h>

int main()
{

int i,j,n,f=0;
printf("Enter the length\n");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
for(j=2;j<i;j++)
{
if((i%j)==0)
{
f=1;
break;
}
f=0;
}
if(f==0)
printf("%d ",i);
}

}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why n++ execute faster than n+1 ?

3042


Explain how do you list a file’s date and time?

1047


Write a program to generate the Fibinocci Series

1252


Explain what is wrong with this program statement? Void = 10;

1274


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

1167


Why does everyone say not to use gets?

1118


Why is c still so popular?

1057


Give basis knowledge of web designing ...

2028


provide an example of the Group by clause, when would you use this clause

2201


How can I prevent another program from modifying part of a file that I am modifying?

1068


What is the heap in c?

1093


What are valid operations on pointers?

1217


What is difference between class and structure?

1127


What is the difference between printf and scanf )?

1110


What is the use of a semicolon (;) at the end of every program statement?

1522