Contohnya OUTPUTnya ada dibawah ini :
Dan kalo mw liat kodingannya ada dibawah ini :
#include
#include
#include
void main()
{
struct mhs
{
char npm[9];
char nama[25];
char kelas[30];
int UTS, UAS, total;
} pmhs[10];
int i,n;
clrscr();
printf("PROGRAM DATA MAHASISWA \n");
printf("---------------------- \n\n");
printf("Masukkan Banyaknya Data : ");
scanf("%d",&n);
printf("\n");
for (i=0; i
{
printf("Input Data Mahasiswa Ke-%d\n",i+1);
printf("Nama Anda : ");
scanf("%s",&pmhs[i].nama);
printf("NPM Anda : ");
scanf("%s",&pmhs[i].npm);
printf("kelas anda : ");
scanf("%s",&pmhs[i].kelas);
printf("Nilai UTS : ");
scanf("%d",&pmhs[i].UTS);
printf("Nilai UAS : ");
scanf("%d",&pmhs[i].UAS);
pmhs[i].total= (pmhs[i].UTS * 0.70) + (pmhs[i].UAS * 0.30) + 1;
printf("\n\n");
}
printf("Tekan Sembarang tombol ... !");
getch();
clrscr();
printf(" Output Data Mahasiswa \n\n");
printf("=============================================================\n");
printf("No. Nama NPM Kelas UTS UAS TOTAL\n");
printf("=============================================================\n");
for (i=0; i
{
gotoxy(2, i+6); printf("%d.",i+1);
gotoxy(7, i+6); printf("%s",pmhs[i].nama);
gotoxy(22, i+6); printf("%s",pmhs[i].npm);
gotoxy(33, i+6); printf("%s",pmhs[i].kelas);
gotoxy(45, i+6); printf("%d\n",pmhs[i].UTS);
gotoxy(51, i+6); printf("%d\n",pmhs[i].UAS);
gotoxy(57,i+6);; printf("%d\n",pmhs[i].total);
}
printf("=============================================================\n");
getch();
}
___Semoga Postingan ini bermanfaat untuk anda___
---====nothing is impossible in this world====---
No comments:
Post a Comment
kritik dan saran kirim aja disini..