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
What is far pointer in c?
Which is better between malloc and calloc?
Who developed c language and when?
What is the use of f in c?
What is volatile c?
Give differences between - new and malloc() , delete and free() ?
Can you add pointers together? Why would you?
Explain how can I remove the trailing spaces from a string?
Are global variables static in c?
What is quick sort in c?
how to introdu5ce my self in serco
what is the different bitween abap and abap-hr?
How do I determine whether a character is numeric, alphabetic, and so on?
What are type modifiers in c?
Explain how can you be sure that a program follows the ansi c standard?