write the program for prime numbers?
Answer Posted / karthika
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("\n entert a number");
scanf("%d",&num);
while(c<=num-1)
{
if(num%i==0)
{
printf("given number is not a prime number\n");
break;
}
i++;
}
if(i==num);
printf(given number is a prime number\n");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does 3 mean in texting?
What is uint8 in c?
What is a rvalue?
Explain what is the general form of a c program?
What is define directive?
What are the advantages and disadvantages of a heap?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Is file a keyword in c?
How do I round numbers?
What would be an example of a structure analogous to structure c?
What is the difference between exit() and _exit() function?
What are the types of functions in c?
What is array of structure in c?