write and read time in/from binary file using fstream in c++ Test Case 1 Input (stdin) 10 10 15 Expected Output Time 10:10:15 has been written into file The time is 10:10:15 Test Case 2 Input (stdin) 20 20 25 Expected Output Time 20:20:25 has been written into file The time is 20:20:25
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<"Time "<<a<<":"<<b<<":"<<c<<" has been written into file\n";
cout<<"The time is "<<a<<":"<<b<<":"<<c;
return 0;
}