write the program for prime numbers?
Answer Posted / biswa
void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 311 Yes | 310 No |
Post New Answer View All Answers
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is #line?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
What is use of bit field?
What does struct node * mean?
What is bubble sort technique in c?
What is scanf () in c?
Can the curly brackets { } be used to enclose a single line of code?
Can we add pointers together?
What is variable declaration and definition in c?
What’s the special use of UNIONS?
Is there a way to jump out of a function or functions?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays