Posts

C++ coding to find prime number between two interval

Image
C++ Program to find Prime number Hiii friends today i will tell how to make a C++ program which will tell prime number between 2 intervals and if  you don't have knowledge about C++ you can check ...  So lets start the coding for this is:- ------------------------------------------------------------------------------------------------------------------------- #include<iostream.h> void main()  { int a,b,i,c; cout<<"Enter the 1st interval:"; cin>>a; cout<<"Enter the 2nd interval:"; cin>>b;  while(a<b)  { c=0; for(i=2;i<=a/2;i++) { if(a%i==0) { c=1; break; }    }    if(c==0)    cout<<"the prime are:"<<a<<endl;     ++a; }                                           ...