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 |
How do I use void main?
write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...
How is a two dimensional array passed to function when the order of matrix is not known at complie time?
convert 12345 to 54321 withoutusing strig
p*=(++q)++*--p when p=q=1 while(q<=6)
What is p in text message?
What are # preprocessor operator in c?
what is diff between localstatic and globalstatis variable possible 2 use in another file...?
Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0
Difference between goto, long jmp() and setjmp()?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
C program to perform stack operation using singly linked list