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 / rama

#include<stdio.h>
main()
{
int n,i,r;
clrscr();
printf("Enter the positive integer value");
scanf("%d",&n)
i=2;
step1:
if(i<=sqrt(n))
{
r=n%i;
if(r==0)
{
printf("%d is not a prime",n);
goto end;
}
}
else
{
i++;
goto step1;
}
printf("%d is prime number",n);
end:
printf(" ");
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give example of a pure virtual function in c++?

1174


What do you mean by late binding?

1129


Is c# written in c++?

986


What is an orthogonal base class in c++?

1162


Can we specify variable field width in a scanf() format string? If possible how?

1269


What is an inclusion guard?

1202


Differentiate between the message and method in c++?

1075


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1561


Is ca high or low level language?

1084


Can we use pointers in c++?

1056


You want to link a c++ program to c functions. How would you do it?

1002


When should I use unitbuf flag?

1018


How const int *ourpointer differs from int const *ourpointer?

1141


What is the use of endl in c++?

1023


How many namespaces are there in c++?

1075