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

What does p mean in physics?

1037


Why do we use main function?

1177


Is there a way to jump out of a function or functions?

1091


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1233


How is a null pointer different from a dangling pointer?

1023


explain what is an endless loop?

1082


What is the use of function overloading in C?

1169


What is a dynamic array in c?

1157


What is a void pointer in c?

1105


Tell me can the size of an array be declared at runtime?

1042


What is c language in simple words?

1068


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

1127


Can true be a variable name in c?

1039


What do you mean by c what are the main characteristics of c language?

1031


What are the properties of union in c?

1055