#include<iostream>
using namespace std;
struct pelajar
{
double CPA,CGPA;
char Nama[40];
};
int main(void)
{
int i;
pelajar DEIS[5];
// --------------baca data----------------
for(i=0;i<=4;i++)
{
cout<<" Sila masukkan nama pelajar ";
cin>>DEIS[i].Nama;
cout<<" Sila masukkan CPA dan CGPA Pelajar ";
cin>>DEIS[i].CPA>>DEIS[i].CGPA;
}
//-------------cetak data-----------------
for(i=0;i<=4;i++)
{
cout<<"Nama :"<<DEIS[i].Nama<<endl;
cout<<"CPA :"<<DEIS[i].CPA<<endl;
cout<<"CGPA :"<<DEIS[i].CGPA<<endl;
}
return 0;
}
No comments:
Post a Comment