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 we use stdio h in c?

1096


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2149


How are portions of a program disabled in demo versions?

1343


How to declare pointer variables?

1315


Explain how are 16- and 32-bit numbers stored?

1306


Explain how do you list files in a directory?

1113


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1189


Write a Program to accept different goods with the number, price and date of purchase and display them

6296


Are c and c++ the same?

1103


Do you know the difference between malloc() and calloc() function?

1111


What is the need of structure in c?

1186


Write a program to reverse a given number in c language?

1163


Explain what happens if you free a pointer twice?

1134


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

5534


What is abstract data structure in c?

1109