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
what is stack , heap ,code segment,and data segment
What is meant by keywords in c?
What are different types of pointers?
What is the difference between test design and test case design?
If you know then define #pragma?
What is assignment operator?
Why doesn't C support function overloading?
Why should I prototype a function?
What does 3 mean in texting?
How pointers are declared?
Explain what is the use of a semicolon (;) at the end of every program statement?
Why is struct padding needed?
What is file in c preprocessor?
What is the general form of #line preprocessor?
What is size of union in c?