write the program for prime numbers?
Answer Posted / noble
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter any number:");
scanf("%d",&a);
for(b=2;b<=a-1;b++)
{
if(a%b==0)
break;
}
if(a==b)
{
printf("%d is prime number",a);
}
else
{
printf("%d is not prime number",a);
}
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
provide an example of the Group by clause, when would you use this clause
What is the difference between declaring a variable and defining a variable?
What are the storage classes in C?
What are local variables c?
What is 1d array in c?
What is the difference between NULL and NUL?
Which is an example of a structural homology?
Tell me what are bitwise shift operators?
Give differences between - new and malloc() , delete and free() ?
What is the most efficient way to store flag values?
Why n++ execute faster than n+1 ?
What are dangling pointers? How are dangling pointers different from memory leaks?
What is pre-emptive data structure and explain it with example?
Explain what is wrong with this statement? Myname = ?robin?;
What is the purpose of ftell?