For Daily Free Study Material Join wiredfaculty Whatsapp Group | Download Android App | Ncert Book Download
Sponsor Area
Find the output of the following program:
#include<iostream.h> class METRO { int Mno, TripNo,PassengerCount; public: METRO (int Tmno=1) { Mno=Tmno;TripNo=0;PassengerCount=0; } void Trip(int PC=20) { TripNo++;PassengerCount+=PC; } void StatusShow() { cout<<Mno<<':'<<TripNo<<':'<<PassengerCount<<endl; } }; void main() { METRO M(5),T; M.Trip(); T.Trip(50); M.StatusShow(); M.Trip(30); T.StatusShow(); M.StatusShow(); }