Nama: Basuki Nim: 2014081029 Kelas: TI.B Tugas Modul 7: Struct Buku (Char Judul (35) Char Pengarang

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Nama : Basuki

Nim : 2014081029
Kelas : TI.B
Tugas modul 7
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{

int i, j=1;
struct
{

char nim[5];
char nama[15];
float nilai;
} mhs[5];
clrscr();
for(i=0; i<2; i++)
{

cout<<"masukan NIM
cout<<"masukan Nama

= "; cin>>mhs[i].nim;
= "; cin>>mhs[i].nama;

cout<<"masukan Nilai Akhir = "; cin>>mhs[i].nilai;


}

for(i=0; i<2; i++)


{

cout<<"Data Ke - "<<j++<<endl;
cout<<"NIM
= "<<mhs[i].nim<<endl;
cout<<"Nama
= "<<mhs[i].nama<<endl;
cout<<"Nilai Akhir = "<<mhs[i].nilai<<endl;
cout<<endl;
getch();
}

struct buku
{
char judul[35];
char pengarang[25];

int jumlah;
};
void main()
{
clrscr();
buku novel;
strcpy(novel.judul,"Meriam Benteng Navarone");
strcpy(novel.pengarang,"Alistair Maclean");
novel.jumlah=12
cout<
cout<
cout<
getche();
}

You might also like