write the program for prime numbers?
Answer Posted / d.sukumar
void main()
{
int i,k;int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
k=n%i;
if(k==0)
{
count++;
}
}
if(count==1)
printf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is quick sort in c?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
explain what is a newline escape sequence?
When the macros gets expanded?
List out few of the applications that make use of Multilinked Structures?
Write the control statements in C language
Which type of language is c?
What is the size of a union variable?
What is malloc() function?
Explain high-order bytes.
Why we not create function inside function.
Is there a way to switch on strings?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is a pointer in c?