I saw someone creating a function that has an unknown number of arguments:
public static double calculator(double ... value){
double result=0d;
for(int i=0;i<?;i++){
result+=value;
}
return result
}
Now I'm trying to create a for
loop that will run the number of times as the number of arguments entered so:
double calc = calculator(1,2,3,4,5)
this will make the for loop run 5 times.