write the program for prime numbers?
Answer Posted / venkat reddy
#include<stdio.h>
main()
{
int i,n,count=0;
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("not prime no.");
}
else
printf("prime");
}
Is This Answer Correct ? | 344 Yes | 155 No |
Post New Answer View All Answers
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Explain what is the stack?
Does sprintf put null character?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What does & mean in scanf?
What is line in c preprocessor?
Why c is called free form language?
How main function is called in c?
What is a keyword?
Write a program to reverse a given number in c language?
What is calloc() function?
Why do we use main function?
How can I sort a linked list?
What is static function in c?
What does %d do in c?