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 formal argument?
Here is a neat trick for checking whether two strings are equal
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
How can I access an I o board directly?
What is s or c?
What language is c written?
What are identifiers and keywords in c?
Difference between pass by reference and pass by value?
What is a program flowchart and explain how does it help in writing a program?
Explain what math functions are available for integers? For floating point?
What happens if a header file is included twice?
how should functions be apportioned among source files?
How can I find the modification date of a file?
How can you allocate arrays or structures bigger than 64K?