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 / shrikanth s.hallikhed

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,flag=0,ctr;
printf("enter the number to be checked\n");
scanf("%d",&n);
for(ctr=2;ctr<=sqrt(n);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");
getch();
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between union and anonymous union?

1306


Is c still relevant?

1087


How can I implement a delay, or time a users response, with sub-second resolution?

1078


What is the total generic pointer type?

1159


How can I direct output to the printer?

1324


What is the use of a ‘’ character?

1092


given post order,in order construct the corresponding binary tree

2786


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1637


What does c in a circle mean?

1079


What are the different types of control structures in programming?

1136


‎How to define structures? · ‎

1089


What are the primitive data types in c?

1079


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1058


What are dangling pointers in c?

1234


What is a static function in c?

1167