SlideShare a Scribd company logo
1 of 2
Download to read offline
1. The recursive factorial program is:
import java.util.*;
import java.io.*;
class Fact1
{
int x=1;
int a;
Fact obj = new Fact();
int b=obj.e;
int fact(int n)
{
if (x==1)
System.out.print(n+"!=");
else{
a=n;
if (x==2)
{
System.out.print(a+1+"!*"+a+"!=");
}
else{
for (int i=0;i
Solution
1. The recursive factorial program is:
import java.util.*;
import java.io.*;
class Fact1
{
int x=1;
int a;
Fact obj = new Fact();
int b=obj.e;
int fact(int n)
{
if (x==1)
System.out.print(n+"!=");
else{
a=n;
if (x==2)
{
System.out.print(a+1+"!*"+a+"!=");
}
else{
for (int i=0;i

More Related Content

More from info401595

When fertilization occurs between two true-breeding parents that dif.pdf
When fertilization occurs between two true-breeding parents that dif.pdfWhen fertilization occurs between two true-breeding parents that dif.pdf
When fertilization occurs between two true-breeding parents that dif.pdf
info401595
 
Wall Street represents the U.S financial markets that include stocks.pdf
Wall Street represents the U.S financial markets that include stocks.pdfWall Street represents the U.S financial markets that include stocks.pdf
Wall Street represents the U.S financial markets that include stocks.pdf
info401595
 
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdfThis is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
info401595
 
Information security principles to the private versus public sector.pdf
Information security principles to the private versus public sector.pdfInformation security principles to the private versus public sector.pdf
Information security principles to the private versus public sector.pdf
info401595
 
Chronic long term Diabetes mellitus may result in a disease of nervo.pdf
Chronic long term Diabetes mellitus may result in a disease of nervo.pdfChronic long term Diabetes mellitus may result in a disease of nervo.pdf
Chronic long term Diabetes mellitus may result in a disease of nervo.pdf
info401595
 
Ans.) A vampire is a being from old stories who subsists by nourishi.pdf
Ans.) A vampire is a being from old stories who subsists by nourishi.pdfAns.) A vampire is a being from old stories who subsists by nourishi.pdf
Ans.) A vampire is a being from old stories who subsists by nourishi.pdf
info401595
 

More from info401595 (20)

When fertilization occurs between two true-breeding parents that dif.pdf
When fertilization occurs between two true-breeding parents that dif.pdfWhen fertilization occurs between two true-breeding parents that dif.pdf
When fertilization occurs between two true-breeding parents that dif.pdf
 
Wall Street represents the U.S financial markets that include stocks.pdf
Wall Street represents the U.S financial markets that include stocks.pdfWall Street represents the U.S financial markets that include stocks.pdf
Wall Street represents the U.S financial markets that include stocks.pdf
 
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdfThis is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
This is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
 
SolutionStarting with the definition of true strain as = ln(LLo).pdf
SolutionStarting with the definition of true strain as = ln(LLo).pdfSolutionStarting with the definition of true strain as = ln(LLo).pdf
SolutionStarting with the definition of true strain as = ln(LLo).pdf
 
E) only one possible oxidation state per element,.pdf
                     E) only one possible oxidation state per element,.pdf                     E) only one possible oxidation state per element,.pdf
E) only one possible oxidation state per element,.pdf
 
Lithium hydroxide is the name of the Arrhenius base that contains th.pdf
Lithium hydroxide is the name of the Arrhenius base that contains th.pdfLithium hydroxide is the name of the Arrhenius base that contains th.pdf
Lithium hydroxide is the name of the Arrhenius base that contains th.pdf
 
c. causes denaturation for proteins in solution .pdf
                     c. causes denaturation for proteins in solution  .pdf                     c. causes denaturation for proteins in solution  .pdf
c. causes denaturation for proteins in solution .pdf
 
Information security principles to the private versus public sector.pdf
Information security principles to the private versus public sector.pdfInformation security principles to the private versus public sector.pdf
Information security principles to the private versus public sector.pdf
 
is the constant response exhibited by a receptor of radiation during.pdf
is the constant response exhibited by a receptor of radiation during.pdfis the constant response exhibited by a receptor of radiation during.pdf
is the constant response exhibited by a receptor of radiation during.pdf
 
C I figured it out myself .pdf
                     C I figured it out myself                        .pdf                     C I figured it out myself                        .pdf
C I figured it out myself .pdf
 
In orderto evaporate the isopropyl acetate until the phenyl sulfone .pdf
In orderto evaporate the isopropyl acetate until the phenyl sulfone .pdfIn orderto evaporate the isopropyl acetate until the phenyl sulfone .pdf
In orderto evaporate the isopropyl acetate until the phenyl sulfone .pdf
 
H2SO4 (aq) ---- H+ (aq) + HSO4-(aq) HSO4- (aq) ---- H+ (aq) + S.pdf
H2SO4 (aq) ---- H+ (aq) + HSO4-(aq) HSO4- (aq) ---- H+ (aq) + S.pdfH2SO4 (aq) ---- H+ (aq) + HSO4-(aq) HSO4- (aq) ---- H+ (aq) + S.pdf
H2SO4 (aq) ---- H+ (aq) + HSO4-(aq) HSO4- (aq) ---- H+ (aq) + S.pdf
 
Absolutely correct. You dont need any more help t.pdf
                     Absolutely correct. You dont need any more help t.pdf                     Absolutely correct. You dont need any more help t.pdf
Absolutely correct. You dont need any more help t.pdf
 
BaSO3 combines with HCl aq to form BaCl2 +H2O and.pdf
                     BaSO3 combines with HCl aq to form BaCl2 +H2O and.pdf                     BaSO3 combines with HCl aq to form BaCl2 +H2O and.pdf
BaSO3 combines with HCl aq to form BaCl2 +H2O and.pdf
 
does not have a velocity function since it does not satisfy the cont.pdf
does not have a velocity function since it does not satisfy the cont.pdfdoes not have a velocity function since it does not satisfy the cont.pdf
does not have a velocity function since it does not satisfy the cont.pdf
 
Chronic long term Diabetes mellitus may result in a disease of nervo.pdf
Chronic long term Diabetes mellitus may result in a disease of nervo.pdfChronic long term Diabetes mellitus may result in a disease of nervo.pdf
Chronic long term Diabetes mellitus may result in a disease of nervo.pdf
 
a. OCS since it is a polar molecule while CO2 not.pdf
                     a. OCS since it is a polar molecule while CO2 not.pdf                     a. OCS since it is a polar molecule while CO2 not.pdf
a. OCS since it is a polar molecule while CO2 not.pdf
 
Ans.) A vampire is a being from old stories who subsists by nourishi.pdf
Ans.) A vampire is a being from old stories who subsists by nourishi.pdfAns.) A vampire is a being from old stories who subsists by nourishi.pdf
Ans.) A vampire is a being from old stories who subsists by nourishi.pdf
 
1. Possible chances 1, 3, 5, 7, 9, 11, 13, 15, 17, 19;     Probab.pdf
1. Possible chances 1, 3, 5, 7, 9, 11, 13, 15, 17, 19;     Probab.pdf1. Possible chances 1, 3, 5, 7, 9, 11, 13, 15, 17, 19;     Probab.pdf
1. Possible chances 1, 3, 5, 7, 9, 11, 13, 15, 17, 19;     Probab.pdf
 
-7 & 16.Solution-7 & 16..pdf
-7 & 16.Solution-7 & 16..pdf-7 & 16.Solution-7 & 16..pdf
-7 & 16.Solution-7 & 16..pdf
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

1. The recursive factorial program isimport java.util.; import.pdf