write the program for prime numbers?
Answer Posted / venkat reddy
#include<stdio.h>
main()
{
int i,n,count=0;
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("not prime no.");
}
else
printf("prime");
}
| Is This Answer Correct ? | 344 Yes | 155 No |
Post New Answer View All Answers
What is FIFO?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is the difference between NULL and NUL?
What are the characteristics of arrays in c?
What does printf does?
praagnovation
What is indirection in c?
code for replace tabs with equivalent number of blanks
What is the difference between abs() and fabs() functions?
Which node is more powerful and can handle local information processing or graphics processing?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What are directives in c?
What are keywords in c with examples?
Can you please explain the difference between malloc() and calloc() function?