write the program for prime numbers?
Answer Posted / biswa
void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 311 Yes | 310 No |
Post New Answer View All Answers
What are pointers? What are different types of pointers?
What is a macro?
what is reason of your company position's in india no. 1.
Explain low-order bytes.
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Explain what are run-time errors?
What is identifier in c?
What is atoi and atof in c?
What is use of pointer?
What is the main difference between calloc () and malloc ()?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
Explain what is the difference between far and near ?
What is call by value in c?
What is function and its example?