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 do mean by network ?
What will be your course of action for a push operation?
What is the stack in c?
What are the application of void data type in c?
What is #line in c?
How can I write a function analogous to scanf?
What are the main characteristics of c language describe the structure of ac program?
Why do we use pointer to pointer in c?
What is the full form of getch?
How can I delete a file?
What is 2c dna?
Write a code to generate divisors of an integer?
Why is c called a mid-level programming language?
What is an endless loop?
What are local variables c?