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
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is the use of bit field?
Write a program to implement queue.
Which is better oop or procedural?
what are # pragma staments?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
List the difference between a While & Do While loops?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
Explain how can you tell whether two strings are the same?
What will be your course of action for a push operation?
Why void main is used in c?
What kind of structure is a house?
What is the purpose of macro in C language?
What is the purpose of the preprocessor directive error?