clc clear //input m1=1 v1=25 m2=2 v2=0 //calculation v=(m1*v1)+(m2*v2)//applying princilpe of conservation of linear momentum v4=v/(m1+m2) //output printf("the velocity with which both will move is %3.3f ms^-1",v4)