Please somebody tell me why the code stated below is generating SIGABRT error. The code is for generating prime numbers between two given numbers which are taken as input by the user.
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int *start;
int *stop;
start= new int[n];
stop= new int[n];
int i;
for(i=0;i<n;i++)
{
cin>>start[n]>>stop[n];
}
int j,k;
for(j=0;j<n;j++)
{
for(i=start[j];i<=stop[j];i++)
{
for(k=1;k<=(i/2);k++)
{
if(i%k==0)
{
break;
}
else if(k==i/2)
{
cout<<i<<"\n";
}
}
}
cout<<"\n";
}
delete[] start;
delete[] stop;
return 0;
}
[\code]