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 pointers?
What are inbuilt functions in c?
How are structure passing and returning implemented?
int far *near * p; means
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
How do I swap bytes?
Write a program for finding factorial of a number.
Can you subtract pointers from each other? Why would you?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What are the types of pointers?
Did c have any year 2000 problems?
How can I implement sets or arrays of bits?
What are the similarities between c and c++?
What is union in c?
what is the difference between 123 and 0123 in c?