The time period of a simple pendulum is given by formula:-
T = 2π√(l/g)
Write a program in java to calculate the time period of a simple pendulum by taking its length and acceleration due to gravity as inputs.
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class KboatSimplePendulum
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter length: ");
double l = in.nextDouble();
System.out.print("Enter g: ");
double g = in.nextDouble();
double t = 2 * (22.0 / 7.0) * Math.sqrt(l/g);
System.out.println("T = " + t);
}
}
Explanation:
(very very sorry for that i say u )
Similar questions