write the program for prime numbers?
Answer Posted / anesh kumar
# include <iostream.h>
# include <conio.h>
int main()
{
int i,j=2,num=0;
cout<<"\n Enter the number";
cin>>i%j>>i;
while(j<=i/2)
{
if(i%j==0)
{
Cout<<"%d Is not prime number"<<i;
ch=1;
break;
}
else
{
j++;
}
}
if(num==0)
{
Cout<<"%d Is prime number"<<i;
}
getch();
return 0;
}
Is This Answer Correct ? | 0 Yes | 0 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)
Why isnt any of this standardized in c?
What is the difference between new and malloc functions?
What is the -> in c?
How can I get the current date or time of day in a c program?
Write a program to print ASCII code for a given digit.
Do pointers need to be initialized?
Why do some versions of toupper act strangely if given an upper-case letter?
Do pointers store the address of value or the actual value of a variable?
Differentiate between functions getch() and getche().
What is c language in simple words?
What are the disadvantages of c language?
Why string is used in c?
What is the advantage of a random access file?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above