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
write a program to print data of 5 five students with structures?
What is s in c?
What is a memory leak? How to avoid it?
What is main function in c?
string reverse using recursion
What are the different types of linkage exist in c?
What does & mean in scanf?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
What is .obj file in c?
What is the process to create increment and decrement stamen in c?
What is new line escape sequence?
What is variable declaration and definition in c?
Should I learn data structures in c or python?
What's the best way of making my program efficient?
How will you delete a node in DLL?