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...

check whether a no is prime or not.

Answer Posted / paramjeet singh

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,c;
printf("enter any number\n");
scanf("%d",&i);
printf("you have entered=%d\n",i);
for(c=2;c<=i-1;c++)
{
if(i%c==0)
printf("this no.is not a prime number");
}
printf("this is prime number");
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How a new operator differs from the operator new?

1059


Do you know the problem with overriding functions?

1035


What is the most useful programming language?

995


What do you mean by function overriding & function overloading in c++?

1097


What is the best it certification?

1058


What do you mean by function and operator overloading in c++?

991


Why do we use templates?

990


Is it possible for the objects to read and write themselves?

1053


What do the header files usually contains?

1000


what is a class? Explain with an example.

1100


Using a smart pointer can we iterate through a container?

1022


write a programme to get a character and thier ASCII value

2993


Can a function take variable length arguments, if yes, how?

959


How to defines the function in c++?

1050


Is c# written in c++?

923