write the program for prime numbers?
Answer Posted / pritam neogi
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i;
clrscr();
printf(" Enter the Number U want to check:");
scanf("%d",&no);
i=2;
while(i<=no-1)
{
if(no%i==0)
{
printf(" %d is not Prime number",no );
// break;
}
i=i+1;
}
if(no==i)
printf("%d is a prime Number",no);
getch();
}
| Is This Answer Correct ? | 24 Yes | 17 No |
Post New Answer View All Answers
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
Explain do array subscripts always start with zero?
How do I get a null pointer in my programs?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is equivalent to ++i+++j?
how can I convert a string to a number?
How do I copy files?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
What is strcmp in c?
What are the uses of null pointers?
Why is event driven programming or procedural programming, better within specific scenario?
What is structure in c definition?
How do you use a pointer to a function?
When can a far pointer be used?
Explain the use of 'auto' keyword