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...

how to find the given number is prime or not?

Answer Posted / rahul tiwari

main()
{
int n,ctr=2,flag=0;
printf("enter the number to be checked\n");
scanf("%d",&n);
for(ctr=2;ctr<=n/2;ctr++)
{
if(n%ctr==0)
{
flag=1;
break;
}
}
if(flag==1)
printf("the given number is prime\n");
else
printf("the given number is not prime\n");
flag=9
getch();
}

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1136


How is a null pointer different from a dangling pointer?

1087


why we wont use '&' sing in aceesing the string using scanf

2427


Who is the founder of c language?

1224


Explain about the constants which help in debugging?

1421


Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent

1873


What does node * mean?

1307


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1233


What are the disadvantages of external storage class?

1105


What is c programming structure?

1278


Can variables be declared anywhere in c?

1149


How do I use void main?

1146


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1136


What do you mean by invalid pointer arithmetic?

1131


Can you explain the four storage classes in C?

1169