write the program for prime numbers?
Answer Posted / oza priyanka
#include<stdio.h>
void main()
{
int num,i,cnt;
clrscr();
printf("\n\nEnter the number = ");
scanf("%d",&num);
for(i=2,cnt=0;i<num;i++)
{
if(num%i==0)
cnt=1;
}
if(cnt==0)
printf("\n\nprime number");
else
printf("\n\n not a prime number");
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Is there any possibility to create customized header file with c programming language?
Explain what is gets() function?
What are header files in c programming?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is c language and why we use it?
What are header files? What are their uses?
What is the process of writing the null pointer?
Why can’t we compare structures?
What is the difference between typedef and #define?
Why is c so important?
What is the difference between struct and typedef struct in c?
What is a program flowchart and how does it help in writing a program?
Explain what are run-time errors?
How main function is called in c?
What is malloc() function?