double OutMax;
double Input[4] ;
double Output[4] ;
double nOutput[4] ;
for ( int i=1 ; i<4; i++) {
if(Input[i] < 0)
{
nOutput[i] = 0;
}
else if (Output[i] > OutMax)
{
nOutput[i] = OutMax;
}
else
{
nOutput[i] = Output[i];
}
}
Isto?