Computer Science, asked by arushjain23, 6 months ago

Write a program which evaluates the expression E = 1 / 2 mv2

. It takes values of m and v in java​

Answers

Answered by dattarajshinde44
3

Answer:

import java.util.*;

public class Question {

 public static void main(String[] args) {

  Scanner sc = new Scanner(System.in);

  System.out.println("Enter Value Of M");

  int m = sc.nextInt();

  System.out.println("Enter Value Of V");

  int v = sc.nextInt();

  double e = 1/2*m*v*2;

  System.out.println("Answer = "+e);

}

}

Answered by anindyaadhikari13
7

Question:-

  • Write a program which evaluates the expression E = 1/2mv²

Program:-

import java.util.*;

class Program

{

public static void main()

{

Scanner sc=new Scanner(System.in);

double m, v, e;

System.out.print("Enter mass: ");

m=sc.nextDouble();

System.out.print("Enter velocity: ");

v=sc.nextDouble();

e=1/2.0*m*v*v;

System.out.println("Kinetic Energy: "+e);

}

}

Similar questions