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 benefit of using const for declaring constants?
praagnovation
How can I split up a string into whitespace-separated fields?
Is fortran still used today?
What is the purpose of type declarations?
Explain what does it mean when a pointer is used in an if statement?
What are the advantages and disadvantages of a heap?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is difference between structure and union with example?
What is a floating point in c?
What is pragma in c?
Explain how can you restore a redirected standard stream?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
i want to know the procedure of qualcomm for getting a job through offcampus
What is wrong with this code?