Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are pointers?

1052


What are inbuilt functions in c?

991


How are structure passing and returning implemented?

1002


int far *near * p; means

3512


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

1661


How do I swap bytes?

1030


Write a program for finding factorial of a number.

1042


Can you subtract pointers from each other? Why would you?

922


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1101


What are the types of pointers?

1045


Did c have any year 2000 problems?

1069


How can I implement sets or arrays of bits?

1002


What are the similarities between c and c++?

1018


What is union in c?

1074


what is the difference between 123 and 0123 in c?

1165