We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c1a7fa commit e6bae9eCopy full SHA for e6bae9e
1 file changed
avg.java
@@ -36,7 +36,7 @@ public static void main(String[] args) {
36
System.out.println("Index not found");
37
}
38
int sum=0, count=0;
39
- if(upperIndex>0)
+ if(upperIndex>0 && lowerIndex+1<upperIndex)
40
{
41
for(int i=lowerIndex+1; i<upperIndex; i++)
42
0 commit comments