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

What are predefined functions in c?

1093


What is the benefit of using an enum rather than a #define constant?

1235


What is f'n in math?

1067


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

2461


Do you know what are the properties of union in c?

1079


Explain output of printf("Hello World"-'A'+'B'); ?

1494


Why do we use static in c?

1125


What is #line used for?

1024


What is stack in c?

1077


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2806


Explain what will the preprocessor do for a program?

1063


How can I use a preprocessorif expression to ?

1061


What are different types of operators?

1041


write a program to rearrange the array such way that all even elements should come first and next come odd

2275


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1403