Advertisement
rinaldohack

Untitled

Sep 26th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #define MAX 2
  5.  
  6. struct obat
  7. {
  8.     char jenis[100],merk[100];
  9.     int harga;
  10. };
  11.  
  12. main()
  13. {
  14.     struct obat data;
  15.     printf("jenis : "); scanf("%s",&data.jenis); fflush(stdin);
  16.     printf("merk : "); scanf("%s",&data.merk);fflush(stdin);
  17.     printf("harga : "); scanf("%d",&data.harga);fflush(stdin);
  18.  
  19.     printf("\n\njenis : %s\n",data.jenis);
  20.     printf("merk : %s\n",data.merk);
  21.     printf("harga : %d\n",data.harga);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement