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
What is the condition that is applied with ?: Operator?
What is the difference between far and near ?
Explain what are its uses in c programming?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What header files do I need in order to define the standard library functions I use?
What are the properties of union in c?
What are the types of c language?
Calculate 1*2*3*____*n using recursive function??
Explain void pointer?
What is use of #include in c?
How can I implement sets or arrays of bits?
Tell me with an example the self-referential structure?
What is the use of static variable in c?
What is adt in c programming?
What is volatile variable in c?