write the program for prime numbers?
Answer Posted / pritam neogi
#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 ? | 32 Yes | 16 No |
Post New Answer View All Answers
What are the complete rules for header file searching?
How #define works?
What is define directive?
Why do we use namespace feature?
What is binary tree in c?
Explain how are portions of a program disabled in demo versions?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
can we have joblib in a proc ?
Describe dynamic data structure in c programming language?
What are the characteristics of arrays in c?
write a proram to reverse the string using switch case?
Why array is used in c?
what are # pragma staments?
Explain what is wrong with this program statement? Void = 10;
What is the use of a ‘ ’ character?