Finding the factorial

Report a typo

Write a program that:

  • Reads the integer from the stdin;
  • Prints the value of its factorial.

Ensure your program correctly calculates the factorial value of 0 and all positive numbers.

Sample Input 1:

5

Sample Output 1:

120

Sample Input 2:

0

Sample Output 2:

1
Write a program in Go
package main

import "fmt"

func main() {
// Write your code here
}
___

Create a free account to access the full topic