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

what does static variable mean?

1070


What is the difference between array and linked list in c?

1108


What is wrong with this statement? Myname = 'robin';

1289


Describe the steps to insert data into a singly linked list.

1040


Why we use int main and void main?

1041


Explain how can you tell whether a program was compiled using c versus c++?

1071


What is the 'named constructor idiom'?

1052


Write a program to print fibonacci series using recursion?

1026


What is structure padding in c?

1083


Is c easier than java?

1018


What does %c mean in c?

1038


What is a buffer in c?

967


What are the types of data files?

1171


a program that can input number of records and can view it again the record

1878


What is the function of volatile in c language?

1086