write the program for prime numbers?
Answer Posted / akhilesh singh(m.c.a-iisem ois
main()
{
int i,j=2,ch=0;
clrscr();
printf("\nENTER ANY NUMBER");
scanf("%d",&i);
while(j<=i/2)
{
if(i%j==0)
{
printf("%d IS NOT PRIME",i);
ch=1;
break;
}
else
{
j++;
}
}
if(ch==0)
{
printf("%d IS PRIME",i);
}
}
Is This Answer Correct ? | 1243 Yes | 384 No |
Post New Answer View All Answers
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Is void a keyword in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
how to write a c program to print list of fruits in alpabetical order?
What is the full form of getch?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is clrscr ()?
What is call by reference in functions?
What are extern variables in c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is multidimensional arrays
Where does the name "C" come from, anyway?
How to Throw some light on the splay trees?
Why is main function so important?