whether any alternative code is available for this

I need to compare elements of different arrays and to get an array output. The given code works but not efficient. Is there any alternative code is available using iif.

for(i=0;i<BarCount;i++){

if(var[i]>0)
{	for(j=i;j<BarCount;j++){
		if(var2[j]>0)
		{strength[i]=var2[j]/var[i];
		printf("%f\n",strength[i]);
		break;}}
		
		i=j;
	}
	
	}

When posting the formula, please make sure that you use Code Tags (using </> code button) as explained here: How to use this site.

Using code button

Code tags are required so formulas can be properly displayed and copied without errors.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.