write the program for prime numbers?
Answer Posted / gnanasekaran
int main()
{
int i,j,n,f=0;
printf("Enter the length\n");
scanf("%d",&n);
for(i=2;i<=n/2;i++)
{
for(j=2;j<i;j++)
{
if((i%j)==0)
{
f=1;
break;
}
f=0;
}
if(f==0)
printf("%d ",i);
}
}
| Is This Answer Correct ? | 139 Yes | 81 No |
Post New Answer View All Answers
What is meant by high-order and low-order bytes?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is string concatenation in c?
What is optimization in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
write a c program to find the sum of five entered numbers using an array named number
What does 2n 4c mean?
how is the examination pattern?
How can you access memory located at a certain address?
How can I find out if there are characters available for reading?
Differentiate between calloc and malloc.
Which programming language is best for getting job 2020?
what are enumerations in C
Explain what does the format %10.2 mean when included in a printf statement?
How do you write a program which produces its own source code as output?