1. What is the output of the following program? import java.util.Scanner; public class Factorial { public static void main(String args[]){ Scanner scanner = new Scanner(System.in);...


1. What is the output of the following program?<br>import java.util.Scanner;<br>public class Factorial {<br>public static void main(String args[]){<br>Scanner scanner = new<br>Scanner(System.in);<br>System.out.printIn(

Extracted text: 1. What is the output of the following program? import java.util.Scanner; public class Factorial { public static void main(String args[]){ Scanner scanner = new Scanner(System.in); System.out.printIn("Enter the number:"); scanner.nextInt(); int factorial = fact(num); System.out.println("Factorial of int num = entered number is: "+factorial); } static int fact(int n) { int output; if(n==1){ return 1; } output = fact(n-1)* n; return output; } }

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here