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 / chetan mehra

#include<stdio.h>
#include<conio.h>

void main()
{
int x,y,z;
clrscr();
for(x=2; x<=50; x++)
{
for(y=2; y<x; y++)
{
if(x%y==0)
{
break;
}
}
if(x==y){
printf("%d\n",y);
}

}
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know the use of fflush() function?

1011


Can you please explain the difference between syntax vs logical error?

1133


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1168


What is the use of f in c?

931


Which function in C can be used to append a string to another string?

1176


What is hashing in c language?

1185


Explain what is the advantage of a random access file?

1066


Does * p ++ increment p or what it points to?

1054


a c code by using memory allocation for add ,multiply of sprase matrixes

2743


Why #include is used in c language?

992


in iso what are the common technological language?

2047


What are the primitive data types in c?

1006


Write the control statements in C language

1127


What are structural members?

953


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1650