write the program for prime numbers?
Answer Posted / sham
int main()
{
int i,j,n,f=0;
printf("Enter the length\n");
scanf("%d",&n);
for(i=2;i<=n;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 ? | 180 Yes | 107 No |
Post New Answer View All Answers
write a program fibonacci series and palindrome program in c
What are different types of operators?
How do you print an address?
What is the difference between new and malloc functions?
what is the height of tree if leaf node is at level 3. please explain
What are the types of unary operators?
How can I access an I o board directly?
Explain what are preprocessor directives?
What is difference between union and structure in c?
Difference between Function to pointer and pointer to function
Explain pointer. What are function pointers in C?
Explain how do you determine the length of a string value that was stored in a variable?
What is the difference between memcpy and memmove?
Explain heap and queue.
What is the difference between local variable and global variable in c?