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 prime no program in c++?

Answer Posted / indu

#include<stdio.h>
#include<conio.h>
main()
{
int n,s=0,i;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
s++;
}
if(s>=1)
printf("%d is not prime",n);
else
printf("%d is prime",n);
getch();
}
ill execute it .it's cent percent correct.

Is This Answer Correct ?    40 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much maximum can you allocate in a single call to malloc()?

1153


Why do we use iterators?

1130


What are associate containers?

1096


Explain differences between alloc() and free()?

1207


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

1121


What is a local reference?

1235


Can we define function inside main in c++?

1070


What is data types c++?

1069


How static variables and local variablesare similar and dissimilar?

1094


What is ifstream c++?

1079


Why ctype h is used in c++?

992


What is the difference between global variables and static varables?

1186


Who invented turbo c++?

1114


You run a shell on unix system. How would you tell which shell are you running?

1216


Which function cannot be overloaded c++?

1163