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
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What is this infamous null pointer, anyway?
How do you do dynamic memory allocation in C applications?
Differentiate between the = symbol and == symbol?
How do I use strcmp?
Explain void pointer?
What is sizeof array?
What is the hardest programming language?
Tell us bitwise shift operators?
write a program to print data of 5 five students with structures?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What are the applications of c language?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Write a function that will take in a phone number and output all possible alphabetical combinations
Explain the ternary tree?