oop
oop
3.
import java.util.Scanner;
public class number3 {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter the first number: ");
double num1 = scan.nextDouble();
System.out.print("Enter the second number: ");
double num2 = scan.nextDouble();
scan.close();
System.out.print("Celcius Converted to Fahrenheit:" + (num1-9/5)+32 + "\r\n");
System.out.print("Fahrenheit Converted to Celcius:" + (num2-32)*5/9);
}
}
4.
import java.util.Scanner;
public class number4{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter the first number: ");
double num1 = scan.nextDouble();
System.out.print("Enter the second number: ");
double num2 = scan.nextDouble();
System.out.print("Enter the third number: ");
double num3 = scan.nextDouble();
scan.close();
System.out.print("The average of entered numbers is:" + avr(num1, num2,
num3) );
}