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
Why is it that not all header files are declared in every C program?
What are the types of functions in c?
What is wild pointer in c?
There seem to be a few missing operators ..
write a c program to calculate sum of digits till it reduces to a single digit using recursion
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
When we use void main and int main?
What is string length in c?
What are formal parameters?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What is uint8 in c?
What is f'n in math?
Are there constructors in c?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
explain what are actual arguments?