Struct on struct

18 04 2010
#include <iostream.h>
#include <conio.h>
struct date
{
int dd;
int mm;
int yyyy;
};
struct time
{
int h;
int m;
int s;
};
struct Login
{
char ID[20];
date tgllogin;

time waktulogin;
}login1[3];
void main ()
{
int n;
for(n=0;n<3;n++)
{
cout<<“===========================\n”;
cout<<“DATA = “<<(n+1)<<“\n”;
cout<<“===========================\n”;
cout<<“data login:”<<endl;
cout<<“ID:”;
cin>>login1[n].ID;
cout<<“Tanggal:”<<“bulan:”<<“tahun:”<<endl;
cin>>login1[n].tgllogin.dd;cin>>login1[n].tgllogin.mm;
cin>>login1[n].tgllogin.yyyy;
cout<<“Jam:”<<“menit:”<<“detik:”<<endl;
cin>>login1[n].waktulogin.h;cin>>login1[n].waktulogin.m;
cin>>login1[n].waktulogin.s;
}
for(int i=0;i<3;i++)
{
cout<<“PRINT DATA”<<(i+1)<<“\n”;
cout<<“PRINT DATA:\n”;
cout<<“ID: “<<login1[i].ID<<endl;
cout<<“Tanggal:”<<login1[i].tgllogin.dd<<endl;
cout<<“bulan:”<<login1[i].tgllogin.mm<<endl;
cout<<“tahun:”<<login1[i].tgllogin.yyyy<<endl<<endl;
cout<<“Jam:”<<login1[i].waktulogin.h<<endl;
cout<<“Menit:”<<login1[i].waktulogin.m<<endl;
cout<<“Detik:”<<login1[i].waktulogin.s;
}
getch();
}

Iklan

Aksi

Information

One response

18 04 2010
monang21

untuk ngejalaninnya, tinggal copy paste aja script diatas, trus semua tanda petiknya di replace lagi pake tanda petik biasa. ok. good luck.

Tinggalkan Balasan ke monang21 Batalkan balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s




%d blogger menyukai ini: