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

pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2654


What is this infamous null pointer, anyway?

1070


How do you do dynamic memory allocation in C applications?

1096


Differentiate between the = symbol and == symbol?

1309


How do I use strcmp?

1089


Explain void pointer?

1057


What is sizeof array?

1064


What is the hardest programming language?

1166


Tell us bitwise shift operators?

1105


write a program to print data of 5 five students with structures?

2057


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

1115


What are the applications of c language?

1084


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

1148


Write a function that will take in a phone number and output all possible alphabetical combinations

1063


Explain the ternary tree?

1037