Computer Science, asked by anaborah77, 2 months ago

define a class 'display' as follows

Data members:
int n: to store a number
int fact: to store the factorial of n

Member methods:
a)void input(): to accept the value of n
b) void factorial() to compute the factorial of n
c)void show () to display the factorial

Write a main method to call the above methods

Hints: n!= 1×2×3×.......×n

PLEASE DON'T SPAM I REALLY NEED THIS ANSWER ​

Answers

Answered by nisha263248
1

Answer:

import Java.util.*;

class display

{

public display()

{

x=int n;

y=int fact;

}

void input()

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter the value of n");

int n=sc.nextInt();

}

void factorial()

{

for(int i=1;i<=n;i++)

{

fact=fact*i;

}

void show()

{

System.out.println("fact="+fact);

}

class Trial

{

public static void main()

{

Scanner obj=new Scanner(System.in);

int x=10,y=1;

obj.input();

obj.show()

}

}

Answered by hetalpatel4121982
1

\huge \bf {\red {\underline {\blue {\underline {Answer:—}}}}}

Environmental impact of biogas: A short review of current knowledge Greenhouse gas emissions. ... Carbon dioxide emissions. ... Methane emissions. ... Nitrous oxide. ... Gaseous pollutants from biogas combustion. ... Impact of feedstock and digestate storage and treatment. ... Impact of digestate final use. ... Impact on particulate matter. ... Impact of biogas upgrading to biomethane. ... Global emission potential. ...

Similar questions