I have a issue in LR, can you please help me Scenario is... need...

  • Thread starter Sai Kumar Reddy
  • Start date
  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

S

Sai Kumar Reddy

Guest
I have a issue in LR, can you please help me Scenario is... need to find the highest value from the list of values. what's wrong in my code. can you please look and help me to work on this. //declaration & initialization char arr[10]; int y[100][100]; int location = 1,maximum; //storing values into array n= atoi(lr_eval_string("{Correlation1_count}")); for(i=1;i/finding largest value from array maximum = atoi(lr_eval_string(y[1])); for (i = 1; i maximum) { maximum = y; location = i+1; } }
 
See if it helps #include int main(){ int i,n; float arr[100]; printf("Enter total number of elements(1 to 100): "); scanf("%d",&n); printf("\n"); for(i=0;i* Stores number entered by user. */ { printf("Enter Number %d: ",i+1); scanf("%f",&arr); } for(i=1;i* Loop to store largest number to arr[0] */ { if(arr[0]* Change < to > if you want to find smallest element*/ arr[0]=arr; } printf("Largest element = %.2f",arr[0]); return 0; }
 
Just few things 1) no need to declare y as two dimensional array 2) location parameter won't actually give you the correct location of the maximum value as you have kept it inside of if condition. 3) if you don't want the total array , then you can skip the second for loop and keep the if condition inside of first for loop.