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
Can you apply link and association interchangeably?
Explain union. What are its advantages?
Are there any problems with performing mathematical operations on different variable types?
in linking some of os executables are linking name some of them
What is the difference between break and continue?
What are the advantages and disadvantages of pointers?
What is the difference between #include
What is a good data structure to use for storing lines of text?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is the difference between #include and #include 'file' ?
What does 2n 4c mean?
What does %c do in c?
How can you avoid including a header more than once?
Explain how do you list a file’s date and time?
What is a protocol in c?