Skip to content
Programmingoneonone
Programmingoneonone

Learn everything about programming

  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone
Programmingoneonone

Learn everything about programming

HackerEarth Factorial! problem solution

YASH PAL, 31 July 2024
In this HackerEarth Factorial! problem solution you have been given a positive integer N. You need to find and print the Factorial of this number. The Factorial of a positive integer N refers to the product of all numbers in the range from 1 to N.
hackerEarth Factorial! problem solution

HackerEarth Factorial! problem solution.

import java.io.*;
import java.util.*;
class example_2
{
static Scanner sc=new Scanner(System.in);

public static void main(String args[]) throws Exception
{
long n=sc.nextLong(),prod=1;
for(long i=1;i<=n;i++)
{
prod=prod*i;
}
System.out.println(prod);
}
}

coding problems solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes