- Home »
- Contoh program struct "mencari total biaya sks"
On
Wednesday, May 29, 2013
Contoh program struct :
#include<iostream.h>
#include<stdio.h>
void main(){
struct ini {
char nama[20];
char nim [12];
long int sks;
double biaya;
};
ini data[15];
for(int x=0;x<1;x++)
{cout<<"Nama : ";gets(data[x].nama);
cout<<"NIM : ";cin>>data[x].nim;
cout<<"SKS : ";cin>>data[x].sks;
data[x].biaya=data[x].sks*30000;
cout<<"Biaya : "<<data[x].biaya;
}}
output program diatas :
Silahkan mencoba :)