post #11 of 11
Oh, this compiles.

Code:
#include<iostream>
#include<conio.h>
using namespace std;


void main()
{

 long i,k,start=1,lim=1000,count=0,flag=1,z;
 cout<<"Start\End\Number of Primes\
";

 for(z=1;z<=50;z++)
 {

  for(i=start;i<=lim;i++)
  {

   for(k=2;k<=i/2;k++)
   {
    if((i%k)==0)
     flag=0;
   }//end of k loop

   if(flag==1)
    count++;
   flag=1;

  }// end of i

  cout<<start<<'\'<<lim<<'\'<<count<<endl;
  start+=1000;
  lim+=1000;
  count=0;

 }// end of z loop 
 getch();
}
    
CPUMotherboardGraphicsRAM
Athlon 64 3700+ Sandy Biostar MATX 6100 GeForce 7600 GT 1024 MB G.SKILL PC 3200 
Hard DriveOptical DriveOSMonitor
Western Digital 160 GB ASUS DVD-RW Windows XP MCE '05, Fedora 6 17'' CRT 
PowerCase
FSP 450 Watt Black w/ Window 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Athlon 64 3700+ Sandy Biostar MATX 6100 GeForce 7600 GT 1024 MB G.SKILL PC 3200 
Hard DriveOptical DriveOSMonitor
Western Digital 160 GB ASUS DVD-RW Windows XP MCE '05, Fedora 6 17'' CRT 
PowerCase
FSP 450 Watt Black w/ Window 
  hide details  
Reply