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

#include<stdio.h>
int main()
{
int i,j,n,count=0;
printf("Enter the number:");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
for(j=2;j<=i;j++)
{
if(i%j==0 && i/1==i)
{
count=count+1;
}
}
if(count==1)
{
printf("\n%d",i);
}
count=0;
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3656


What are the 4 types of unions?

1089


Explain pointer. What are function pointers in C?

1145


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.

1469


Why do some versions of toupper act strangely if given an upper-case letter?

1112


What is sizeof in c?

1050


how can f be used for both float and double arguments in printf? Are not they different types?

1121


Write a code to generate a series where the next element is the sum of last k terms.

1287


Why dont c comments nest?

1109


Linked lists -- can you tell me how to check whether a linked list is circular?

1133


what do u mean by Direct access files? then can u explain about Direct Access Files?

2145


Where register variables are stored in c?

997


What does sizeof function do?

1254


What is an auto keyword in c?

1146


What is static memory allocation? Explain

1138