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 void pointers in c?
What is the advantage of c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is a null pointer in c?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What happens if a header file is included twice?
What is page thrashing?
what is the function of pragma directive in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is time complexity c?
If you know then define #pragma?
What is header file definition?
write a program to display all prime numbers
What is nested structure in c?