Thursday, January 24, 2019

√ Pola Pemrograman C++ Struct

ini tumpuan struct.

#include
#include
#include
garis()
{
cout<<"---------------------------";
cout<}

main()
{
   struct
   {
   char nim[10],nama[15];
   int nilai;
   } mhs; //deklarasi&penamaan struct

clrscr();
//data mhs;

cout<<"Input NIM  : ";cin>>mhs.nim;
cout<<"INput NAMA :";gets(mhs.nama);
cout<<"Input NILAI:";cin>>mhs.nilai;
cout<<"\n\n DAta Anda"<garis();
cout<<"NIM  : "<cout<<"NAMA :"<cout<<"NILAI:"<garis();
getch();
}

Sumber http://www.hendrisetiawan.com