write the program for prime numbers?
Answer Posted / pavankumar
void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is #define in c?
What is the description for syntax errors?
Process by which one bit pattern in to another by bit wise operation is?
Why is c fast?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
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
How do we open a binary file in Read/Write mode in C?
What does *p++ do? What does it point to?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
How many parameters should a function have?
Explain logical errors? Compare with syntax errors.
How will you find a duplicate number in a array without negating the nos ?
How was c created?
Write a program to find factorial of a number using recursive function.
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12