Write a program to accept two single dimensional arrays and store 10 integer numbers in each. Store their sum in array S and product in another array P. Print array S and P.

question img

Answers 1

Answer:

import java.util.Scanner;

public class KboatSDAF2C

{

   public static void main(String args[]) {

       Scanner in = new Scanner(System.in);

       double arr[] = new double[20];

       

       System.out.println("Enter 20 temperatures in degree Fahrenheit");

       for (int i = 0; i < arr.length; i++) {

           arr[i] = in.nextDouble();

       }

       

       System.out.println("Temperatures in degree Celsius");

       for (int i = 0; i < arr.length; i++) {

           double tc = 5 * ((arr[i] - 32) / 9);

           System.out.println(tc);

       }

   }

}

If you know the answer add it here!

Can't find the answer?

Log in with Google

or

Forgot your password?

I don't have an account, and I want to Register

Choose a language and a region
How much to ban the user?
1 hour 1 day 100 years