write the program for prime numbers?
Answer Posted / felix c. intelegando
#include<stdio.h>
#include<conio.h>
int main(void)
{
int i,n,count=0;
printf("Enter Number: ");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("Not Prime ");
}
else
printf("Prime");
getch();
return 0;
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is indirection? How many levels of pointers can you have?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Is array name a pointer?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is the difference between call by value and call by reference in c?
What is scope rule of function in c?
What is wrong with this program statement? void = 10;
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
The difference between printf and fprintf is ?
How can I generate floating-point random numbers?
What is property type c?
How reliable are floating-point comparisons?
Explain Function Pointer?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Explain how can I open a file so that other programs can update it at the same time?