Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. typedef struct Date{
  5.     int dd,mm,yyyy;
  6. };
  7.  
  8. typedef struct Time{
  9.     int s,h,m;
  10. };
  11.  
  12. typedef struct Login{
  13.     int ID;
  14.     Date tglLogin;
  15.     Time waktuLogin;
  16. };
  17.  
  18. int main(){
  19.     Login user1;
  20.  
  21.     printf("User 1\n");
  22.     printf("ID :");scanf("%d",&user1.ID);
  23.     printf("Tanggal Login\n");
  24.     printf("Hari : ");scanf("%d",&user1.tglLogin.dd);
  25.     printf("Bulan : ");scanf("%d",&user1.tglLogin.mm);
  26.     printf("Tahun : ");scanf("%d",&user1.tglLogin.yyyy);
  27.     printf("Waktu Login\n");
  28.     printf("Jam : ");scanf("%d",&user1.waktuLogin.h);
  29.     printf("Menit : ");scanf("%d",&user1.waktuLogin.m);
  30.     printf("Detik : ");scanf("%d",&user1.waktuLogin.s);
  31.     printf("Terima Kasih\n");
  32.     printf("===== Data Anda =====\n");
  33.     printf("ID : %d\n",user1.ID);
  34.     printf("Date : %d-%d-%d\n",user1.tglLogin.dd,user1.tglLogin.mm,user1.tglLogin.yyyy);
  35.     printf("Time : %d:%d:%d\n",user1.waktuLogin.h,user1.waktuLogin.m,user1.waktuLogin.s);
  36.     printf("=====================");
  37.     getch();
  38.  
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement