write the program for prime numbers?
Answer Posted / pratibha
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
| Is This Answer Correct ? | 17 Yes | 14 No |
Post New Answer View All Answers
Is c# a good language?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is meant by int main ()?
How will you delete a node in DLL?
What does %2f mean in c?
What is #line in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
When would you use a pointer to a function?
about c language
Write a program with dynamically allocation of variable.
What are the applications of c language?
What does 2n 4c mean?
What is the 'named constructor idiom'?
What is the difference between far and near in c?
Where are c variables stored in memory?