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
What do you mean by dynamic memory allocation in c? What functions are used?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
Why is not a pointer null after calling free?
What are the 4 types of organizational structures?
How can I manipulate strings of multibyte characters?
Explain goto?
What are the benefits of c language?
What are types of functions?
Explain what is a const pointer?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is a function in c?
How can I access an I o board directly?
What is meant by int main ()?
How many identifiers are there in c?
What is the difference between the local variable and global variable in c?