write the program for prime numbers?
Answer Posted / karthika
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("\n entert a number");
scanf("%d",&num);
while(c<=num-1)
{
if(num%i==0)
{
printf("given number is not a prime number\n");
break;
}
i++;
}
if(i==num);
printf(given number is a prime number\n");
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what are enumerations in C
What are the usage of pointer in c?
What is getch () for?
What are the different types of linkage exist in c?
Where are local variables stored in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
How can I sort more data than will fit in memory?
How can I get random integers in a certain range?
What are the disadvantages of c language?
simple program of graphics and their output display
Is main a keyword in c?
What is difference between Structure and Unions?
What is nested structure with example?
Describe the difference between = and == symbols in c programming?
When is a “switch” statement preferable over an “if” statement?