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
What is context in c?
Where are local variables stored in c?
Explain heap and queue.
Is it valid to address one element beyond the end of an array?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is a node in c?
What happens if a header file is included twice?
How can you find out how much memory is available?
What is void pointers in c?
What are the 4 types of unions?
What is the purpose of sprintf?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Lists the benefits of c programming language?
What is openmp in c?
Why doesn't C support function overloading?