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 C language is a procedural language?
which will be first in c compiling ,linking or compiling ,debugging.
What is variable in c with example?
Distinguish between actual and formal arguments.
What is && in c programming?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
Do you know the use of fflush() function?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
What is storage class?
write a c program for greatest of three numbers without using if statment
what is the difference between static variable and register variable?
4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program.