PROBLEM:
create two classes truck and car each containing speed of vehicle,mileage,weight and price.
write a program that can read and compare the values from two classes.use friend function for comparision.
PROGRAM:
#include<iostream.h>
#include<conio.h>
class car;
class truck
{
private:
float speed,mileage,wt,price;
public:
void input()
{
cout<<"enter the speed"<<endl;
cin>>speed;
cout<<"enter the mileage"<<endl;
cin>>mileage;
cout<<"enter the weight"<<endl;
cin>>wt;
cout<<"enter the price"<<endl;
cin>>price;
}