Why does void loop() stop after some samples?

Hello,

I am using Arduino Due. I am not getting any compile time error. After some samples of data void loop() stops executing. Please let know what the problem is. Below is my code.

Thanks and regards
Thippeswamy

#include<SPI.h>
float amplitude=1.5;
int freq1=20; int freq2=12;
int k=20;float A= amplitude*k;
int Fs=10550; float sine[5000]; float Fs1=3000;
int i=0;int reg1=1; int reg2=0;
int sample1=Fs/freq1; float sample2=Fs1/freq2;

void setup() {
int SS=10;
pinMode(SS, OUTPUT);
SPI.begin();
}

void data(int reg, int data) {
digitalWrite(SS,LOW);
SPI.transfer(reg);
SPI.transfer(data);
digitalWrite(SS,HIGH);
}

void loop() {
for(int j=0;j<sample1||i<sample2||i>=sample2);j++) {
float s=Asin((23.14freq1j)/Fs);
sine[j]=s+190;
data(reg1,sine[j]);
if(i<=sample2) {
float s=Asin((23.14freq2i)/Fs1);
sine*=s+190;*
_ data(reg2,sine*);_
_
i++;_
_
} else if(i>sample2) {_
_ float s=Asin((23.14freq2i)/Fs1);
sine
=s+190;
data(reg2,sine);
i++;
}
}
}*_

same question on arduino.stackexchange

Pleas edit your first post and add [­code] before it and [/­code] after it to prevent some of it being interpreted as HTML commands. Unless, of course, your code really does have italics in it.

is the space bar broken on your keyboard?

this packed line

  for(int j=0;j<sample1||i<sample2||i>=sample2);j++) {

if you unpack it a bit reads   for (int j = 0; j < sample1 || i < sample2 || i >= sample2); j++) {

in my world i < sample2 || i >= sample2 will be always true so your loop will never stop