Write a program to print all the prime numbers with in the
given range
Answer Posted / chavidi
void prime(int a,int b)
{
int i,j,c
for(i=a;i<=b;i++)
{
c=0;
for(j=1;j<=a;j++)
{
if(a%j==0)
{
c++;
}
}
if(c==2)
printf(i);
}
}
Is This Answer Correct ? | 8 Yes | 14 No |
Post New Answer View All Answers
What is the benefit of using #define to declare a constant?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is a node in c?
Differentiate fundamental data types and derived data types in C.
Why is this loop always executing once?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Is that possible to store 32768 in an int data type variable?
How to create struct variables?
What are the various types of control structures in programming?
write a programming in c to find the sum of all elements in an array through function.
What is a ternary operator in c?
write a program to rearrange the array such way that all even elements should come first and next come odd
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is selection sort in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.