write the program for prime numbers?
Answer Posted / adhiyamaan
#include<stdio.h>
#include<conio.h>
{
int num,i;
printf("enter the number:");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
if(num%i==0)
{
printf("NOT PRIME");
break;
}
}
if(i==num)
{
printf("PRIME");
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the different types of errors?
What is define c?
What is auto keyword in c?
what is the structure pointer?
Is c still relevant?
What is use of null pointer in c?
What is the collection of communication lines and routers called?
What is .obj file in c?
What are the modifiers available in c programming language?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
How pointer is different from array?
Explain how do you determine the length of a string value that was stored in a variable?
How can you read a directory in a C program?
What is the meaning of ?
What is the benefit of using #define to declare a constant?