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

Function calling procedures? and their differences? Why should one go for Call by Reference?

1099


Explain what are global variables and explain how do you declare them?

1181


Differentiate between the expression “++a” and “a++”?

1264


Explain do array subscripts always start with zero?

1250


Which is the best website to learn c programming?

1091


What are loops c?

1062


What is difference between structure and union in c?

1003


Explain what are multibyte characters?

1207


What is advantage of pointer in c?

1198


What are the applications of c language?

1085


What is a node in c?

987


Is int a keyword in c?

989


Why is this loop always executing once?

1068


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

1317


What are the data types present in c?

1177