write a program to find the given number is prime or not
Answers were Sorted based on User's Feedback
Answer / alex
here is answer
http://www.prepjunk.com/151/program-to-find-the-given-number-is-prime-or-not
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
Why should I use standard library functions instead of writing my own?
Why is sprintf unsafe?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What does int main () mean?
The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;);
1 Answers HCL, Public Service Commission,
Why is c fast?
What tq means in chat?
What are 'near' and 'far' pointers?
main() { static int ivar=5; printf("%d",ivar--); if(ivar) main(); }
What is Lazy evaluation in C? Give an example.
Describe the difference between = and == symbols in c programming?
say the following declaration is correct nr not. int b=a,n=0;