Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Badguy13 Badguy13 is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 399
Rep Power: 14
Badguy13 mempunyai hidup yang Normal
Default [HELP] Mohon Pencerahan nya Gan

Quote:





Buat tipe data bernama hot dog



Tipe data hotdog disusun dari array sayur sebanyak 3 elemen dan elemen-elemennya bertipe data sayur-mayur.

tipe data sayur-mayur memiliki nilai : timun,tomat,salad,kol,wortel,paprika,bawang bombay.

selain disusun dari array sayur,tipe data hot dog juga dibentuk dari variabel isi hot dog yang bertipe data daging.

tipe data daging memiliki nilai : cheese dog,chili dog,jumbo dog,giant dog.

setelah selesai buat tipe data hot dog,buatlah variabel array hot dog 2 elemen dan masing-masing elemen bertipe hot dog

hot[0] menyimpan nilai : timun,paprika,wortel,cheese dog

hot[1] menyimpan nilai : salad,bawang bombay,kol,chili dog






Quote:





#include "conio.h"

#include "iostream.h"



main() {



struct hotdog {

char sayur_mayur[7]=("timun,tomat,salad,kol,wortel,paprika,bawang bombay");

char daging[4]=("cheese dog,chili dog,jumbo dog,giant dog");

};

struct hotdog hot[2];

strcpy(hot[0].sayur_mayur, "timun,paprika,wortel,cheese dog");

strcpy(hot[1].daging, "salad,bawang bombay,kol,chili dog");

int i;

cout

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 07:01 PM.


no new posts