Friday, February 1, 2019

Gravitational Force

  • Problem Description

    Write a Python Program to Find the Gravitational Force Acting Between Two Objects
  • CODING ARENA
  • m1=float(input())
    m2=float(input())
    r=float(input())
    G=6.673*(10**-11)
    f=(G*m1*m2)/(r**2)
    print(round(f,2),"N")
  • Test Case 1

    Input (stdin)
    1000000
    
    500000
    
    20
    
    
    Expected Output
    0.08 N
  • Test Case 2

    Input (stdin)
    90000000
    
    700000
    
    20
    
    
    Expected Output
    10.51 N

No comments:

Post a Comment