This Python program receives an integer n from the user and calculates the result of n × n × n × n.
This is equivalent to computing n⁴ (n to the power of 4), and is useful for practicing exponentiation and multiplication logic.
# Get an integer from the user
n = int(input("Enter an integer: "))
# Calculate n to the power of 4 using multiplication
result = n * n * n * n
# Display the result
print("\n--- Result ---")
print("n × n × n × n =", result)
Enter an integer: 2
--- Result ---
n × n × n × n = 16
- The input n is received using input() and converted to an integer
- The expression n × n × n × n is evaluated using direct multiplication
- This is equivalent to n**4 but uses only the multiplication operator as requested
- The result is printed clearly for the user