Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

how to find prime number using c++


 This is the source code for finding prime number 
#include<iostream.h>
#include<conio.h>
main()
{
      int n,d,p=1;
      cout<<"enter the number?";
      cin>>n;
      d=2;
      while(d<=n/2)
      {
                   if(n%d==0)
                   p=0;
                   d++;
                   }
                   if(p==0)
                   cout<<"not prime number";
                   else
                   cout<<"prime number";
                   getch();
                   }
      End

We recommended visiting
  • Why c++ is a popular programming language
  • C Programming books download
  • how to make the pyramid in c++
  • how to shut down your computer using c++
  • how to find that the given number is a palindrome
  • how to find the larger number using c++