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 a program to find the given number is prime or not

Answer Posted / rabindra nath das

#include<stdio.h>
#include<conio.h>
void main()
int n,k,fl=0,r;
clrscr();
printf("\n Enter the number==>>");
scanf("%d",&d);
for(k=2;k<=n/2 && fl==0;k++)
{
r=n%k;
if(r==0);
fl=1;
}
if(fl==0)
printf("\n %d is a prime number",n);
else
printf("\n %d is not prime number",n);
getch();
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

1265


Explain what is the difference between the expression '++a' and 'a++'?

1153


How are variables declared in c?

1028


What is a scope resolution operator in c?

1206


What is a program flowchart?

1125


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1626


What is the difference between array and linked list in c?

1083


What does struct node * mean?

965


What is a header file?

1029


How do you search data in a data file using random access method?

1255


What are different types of operators?

991


Should I learn c before c++?

1177


Is it possible to have a function as a parameter in another function?

1038


Differentiate between calloc and malloc.

1224


Are enumerations really portable?

978