Ad
  • Custom User Avatar

    If n is negative (i.e., < 0) then the for loop will simply fail to execute since the condition "i < n+1" will be false (as i is set to 1 initially, any negative number + 1 can never be > 1).
    Now, the value of s is not altered and is returned as such (i.e., 0).