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
How can you return multiple values from a function?
Write a program to reverse a given number in c language?
Explain how can you restore a redirected standard stream?
Here is a good puzzle: how do you write a program which produces its own source code as output?
How can I send mail from within a c program?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is ## preprocessor operator in c?
Differentiate between functions getch() and getche().
What is zero based addressing?
How are structure passing and returning implemented?
What is the scope of global variable in c?
What is calloc in c?
Why isnt any of this standardized in c?
Explain how can I manipulate strings of multibyte characters?
What is the concatenation operator?