Write a program segment that computes 1+2+3+...+(n-1)+n, where n is a data value. Follow the loop body with an if statement that compares this value to (n * (n + 1)) / 2 and displays a message that indicates whether the values are the same or different.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here