Program to calculate speed on the basis of distance and time entered by the user JAVA


Write a Program to print speed on the basis of distance and time entered by the user.




import java.util.*;
class speed
{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         System.out.println("Enter distance");
         double d = sc.nextDouble();
         System.out.println("Enter time");
         double t = sc.nextDouble();
         double s = d/t;
         System.out.println(" Speed = " +s);
        
         
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com