write the program for prime numbers?
Answer Posted / biswa
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 ? | 311 Yes | 310 No |
Post New Answer View All Answers
write a program to create a sparse matrix using dynamic memory allocation.
Write a program to identify if a given binary tree is balanced or not.
What is scope of variable in c?
praagnovation
What is volatile, register definition in C
What does it mean when the linker says that _end is undefined?
What is %s and %d in c?
How can I insert or delete a line (or record) in the middle of a file?
What is the difference between array and pointer in c?
code for replace tabs with equivalent number of blanks
What is the right type to use for boolean values in c?
Why enum is used in c?
Is it better to bitshift a value than to multiply by 2?
What are structure members?
Why static variable is used in c?