I have this code
if(arr[i] > 0) {
positive += 1;
}
if(arr[i] < 0) {
negative += 1;=
}
The first condition is not relevant for the second one. Should I left it like that or put else if instead of 2 separated if? Does it make execution time different? What is more readable?
Aucun commentaire:
Enregistrer un commentaire