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 / sham

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 ?    180 Yes 107 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program fibonacci series and palindrome program in c

996


What are different types of operators?

1003


How do you print an address?

1222


What is the difference between new and malloc functions?

1072


what is the height of tree if leaf node is at level 3. please explain

2112


What are the types of unary operators?

1155


How can I access an I o board directly?

1051


Explain what are preprocessor directives?

1029


What is difference between union and structure in c?

1102


Difference between Function to pointer and pointer to function

1037


Explain pointer. What are function pointers in C?

1035


Explain how do you determine the length of a string value that was stored in a variable?

1113


What is the difference between memcpy and memmove?

989


Explain heap and queue.

1034


What is the difference between local variable and global variable in c?

1179