Professional Documents
Culture Documents
h> class weight { public: static float g; float m,w; void accept() { cout<<"Enter the mass of an object on earth"; cin>>m; } static void mass() { m= 9.81; cout<<"Mass by default is:\t"<<m; } void display() { w=m*g; cout<<"\nWeight of the object:"<<w; } }; float weight::g; void main() { clrscr(); weight s; weight::mass(); s.accept(); s.display(); getch(); }
Page 1