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 is a stream water?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
What is wild pointer in c with example?
How do I send escape sequences to control a terminal or other device?
What are the types of bitwise operator?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What is a void * in c?
What is the auto keyword good for?
Suggesting that there can be 62 seconds in a minute?
What are header files and what are its uses in C programming?
What is pass by reference in functions?
How important is structure in life?
Why doesn't C support function overloading?
Can one function call another?
What is the meaning of && in c?