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
Who is the main contributor in designing the c language after dennis ritchie?
Why ca not I do something like this?
What is malloc calloc and realloc in c?
What are shell structures used for?
Explain how do you determine the length of a string value that was stored in a variable?
What is 2 d array in c?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
How can I open files mentioned on the command line, and parse option flags?
What is c language & why it is used?
What is bubble sort in c?
What does the format %10.2 mean when included in a printf statement?
Why is this loop always executing once?
Why & is used in c?
What are control structures? What are the different types?
What are types of structure?