clc; h=0.78; //height in m g=9.8; //gravitational constant in m/sec square v=0.5; //velocity in m/sec t=sqrt((2*h)/g); //calculating t disp(t,"Time required in sec = "); //displaying result s=v*t; //calculating distance disp(s,"Horizontal distance in m = "); //displaying result