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 code in while loop that returns the output of given code?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What is string function in c?
What is conio h in c?
Do you know the use of 'auto' keyword?
What is volatile, register definition in C
What is the significance of an algorithm to C programming?
How are structure passing and returning implemented?
Write a simple code fragment that will check if a number is positive or negative.
Which is better oop or procedural?
What is f'n in math?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What is getche() function?
the question is that what you have been doing all these periods (one year gap)