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 define directive?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
How to draw the flowchart for structure programs?
What is the difference between printf and scanf in c?
What is build process in c?
What is the difference between %d and %i?
Can you explain the four storage classes in C?
What is the difference between #include
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Write a factorial program using C.
What are valid signatures for the Main function?
What is the process to create increment and decrement stamen in c?
What is the modulus operator?
What is uint8 in c?
Is null equal to 0 in sql?