write the program for prime numbers?
Answer Posted / naseer
main(){
int no,i,count=0;
printf("enter any no");
scanf("%d",&no);
//the main logic is here
for(i=2;i<no;i++){
if(no%2==0){
count++;
}
}
if(count>=1)// if the no is less than
//5 then it shows prime
{
printf("not Prime");
}
else
printf("prime");
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the different types of objects used in c?
What is a class c rental property?
Explain what is the benefit of using const for declaring constants?
What is 2 d array in c?
What is meant by initialization and how we initialize a variable?
What is formal argument?
What are pointers really good for, anyway?
What are the types of pointers?
What is a node in c?
What is the difference between c &c++?
Explain how to reverse singly link list.
Is fortran still used today?
What is assert and when would I use it?
Explain 'bit masking'?
When is a void pointer used?