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

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

void main()
{
int a,i , b,flag=0,no;
clrscr();

for(no=2;no<100;no++)
{
for(i=2;i<no;i++)
{
b=no%i;
if(b==0)
{
flag=1;
break;
}
else
{
flag=0;
}
}
if(flag!=1)
{
printf("\n%d",no);
}
}

getch();
}

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use return in c?

994


Explain what does the function toupper() do?

1071


What is the equivalent code of the following statement in WHILE LOOP format?

1301


What are the advantages of external class?

1062


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2466


Can we replace the struct function in tree syntax with a union?

1306


Is calloc better than malloc?

1015


What is the difference between if else and switchstatement

1928


What is build process in c?

1147


What is the difference between arrays and pointers?

1122


What is the use of getchar functions?

1180


What are linker error?

1088


What is the meaning of ?

1034


Can you tell me how to check whether a linked list is circular?

1408


What is the auto keyword good for?

1146