Enter Time Hour And second and print
Enter Time Hour And second and print
Just open your c++ compiler Paste this code.
#include<iostream>
using namespace std;
class time
{
private :
int sec,min,hour;
public:
void getdate()
{
cout<<"Enter Seceond";
cin>>sec;
cout<<"Enter Minute";
cin>>min;
cout<<"Enter Hour";
cin>>hour;
}
void showdate()
{
cout<<sec<<":"<<min<<":"<<hour<<".";
}
};
int main()
{
time t;
t.getdate();
t.showdate();
}
Just open your c++ compiler Paste this code.
#include<iostream>
using namespace std;
class time
{
private :
int sec,min,hour;
public:
void getdate()
{
cout<<"Enter Seceond";
cin>>sec;
cout<<"Enter Minute";
cin>>min;
cout<<"Enter Hour";
cin>>hour;
}
void showdate()
{
cout<<sec<<":"<<min<<":"<<hour<<".";
}
};
int main()
{
time t;
t.getdate();
t.showdate();
}








0 comments: