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 difference between class and structure?
How can I open files mentioned on the command line, and parse option flags?
What are the different categories of functions in c?
How will you delete a node in DLL?
What is operator precedence?
What does it mean when the linker says that _end is undefined?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What is the concatenation operator?
What is this infamous null pointer, anyway?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What is c mainly used for?
How will you find a duplicate number in a array without negating the nos ?
Mention four important string handling functions in c languages .
What is the sizeof () operator?
Explain two-dimensional array.