write the program for prime numbers?
Answer Posted / arfu
#include<stdio.h>
int main()
{
int c,i,n;
c=0;
scanf("%d",&a);
for(i=2;i<a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)`("prime");
else printf ("not a prime");
}
| Is This Answer Correct ? | 110 Yes | 89 No |
Post New Answer View All Answers
Create a simple code fragment that will swap the values of two variables num1 and num2.
What is the difference between mpi and openmp?
Write a Program to find whether the given number or string is palindrome.
Why is c called c?
What are unions in c?
What is an auto variable in c?
Can main () be called recursively?
c program to compute AREA under integral
What is a pointer and how it is initialized?
Is it possible to have a function as a parameter in another function?
What is the use of sizeof?
What are the advantages of using new operator as compared to the function malloc ()?
Write a program to find factorial of a number using recursive function.
Explain void pointer?
code for replace tabs with equivalent number of blanks