Thursday 5 July 2012

Program that demostrate used of structure in c++.

#include<iostream>
using namespace std;

struct time_struct
{
int hour,minute,second;
};

int main()
{
time_struct st;
cout<<"Enter hour";
cin>>st.hour;
cout<<endl;

cout<<"Enter minute";
cin>>st.minute;
cout<<endl;

cout<<"Enter second";
cin>>st.second;
cout<<endl;

cout<<"The time is :-   "<<st.hour<<": "<<st.minute<<": "<st.second;

return 0;
}



1 comment:

  1. Hey my name is Neeraj and i have blog which is related to c++ programming. I want to exchange link between us. If you are interested than let me know. My blog url is cpp-programs.blogspot.com and my email is sareneeru94@gamil.com

    ReplyDelete