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?
I heard that you have to include stdio.h before calling printf. Why?
Can you tell me how to check whether a linked list is circular?
Is c dynamically typed?
Can include files be nested? How many levels deep can include files be nested?
What does 4d mean in c?
Difference between Function to pointer and pointer to function
a c code by using memory allocation for add ,multiply of sprase matrixes
Difference between constant pointer and pointer to a constant.
Compare interpreters and compilers.
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is the use of f in c?
What is infinite loop?
What are formal parameters?
How can you convert integers to binary or hexadecimal?