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 / karthik

#include<stdio.h>
#include<conio.h>
void main()
{
int n,flag;
clrscr();
printf("\n Enter prime no\n");
scanf("%d",&n);
for(int i=2;i<=n/2;i++)
{
if(n%i==0)
{
flag=0;
break;
}
}
if(flag==0)
printf("\n%d is not prime",n);
else
printf("\n %d is prime",n);
getch();
}

Is This Answer Correct ?    21 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

1089


Differentiate between the = symbol and == symbol?

1309


how many key words availabel in c a) 28 b) 31 c) 32

1084


What is c value paradox explain?

1105


What are pointers in C? Give an example where to illustrate their significance.

1238


What does the message "automatic aggregate intialization is an ansi feature" mean?

1200


What are the advantages and disadvantages of a heap?

1218


What is the use of pointers in C?

1095


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2138


Is stack a keyword in c?

1095


With the help of using classes, write a program to add two numbers.

1051


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

1114


What is integer constants?

1090


i have a written test for microland please give me test pattern

2744


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1990