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
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
Explain what is the difference between the expression '++a' and 'a++'?
How are variables declared in c?
What is a scope resolution operator in c?
What is a program flowchart?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What is the difference between array and linked list in c?
What does struct node * mean?
What is a header file?
How do you search data in a data file using random access method?
What are different types of operators?
Should I learn c before c++?
Is it possible to have a function as a parameter in another function?
Differentiate between calloc and malloc.
Are enumerations really portable?