Program Pendataan Mahasiwa
Program Pendataan Mahasiwa
#include
#include
#include
void main ()
{
struct data_mahasiswa
{
char nim [50], unit [60], nama[100], semester[10];
};
int i, n;
struct data_mahasiswa biodata[20];
clrscr();
printf(" ----------------- \n");
printf(" | DATA MAHASISWA |\n");
printf(" ----------------- \n\n");
printf ("Banyak Data : "); scanf ("%d", &n);
for (i=0;i{
clrscr();
printf ("Data ke %d\n", i+1);
printf ("NIM : ");
fflush (stdin);scanf("%s", &biodata[i].nim);
printf ("NAMA : ");
fflush (stdin);scanf("%s", &biodata[i].nama);
printf ("UNIT : ");
fflush (stdin);scanf("%s", &biodata[i].unit);
printf ("SEMESTER : ");
fflush (stdin);scanf("%s", &biodata[i].semester);
}
printf("\n\n");
clrscr ();
printf(" ----------------- \n");
printf(" | DATA MAHASISWA |\n");
printf(" ----------------- \n\n");
printf ("NIM\t\tNAMA\t\tUNIT\tSEMESTER\n\n");
for (i=0;i{
printf ("%s\t%s\t %s\t %s\n", biodata[i].nim, biodata[i].nama, biodata[i].unit, biodata[i].semester);
}
getch();
}
#include
#include
void main ()
{
struct data_mahasiswa
{
char nim [50], unit [60], nama[100], semester[10];
};
int i, n;
struct data_mahasiswa biodata[20];
clrscr();
printf(" ----------------- \n");
printf(" | DATA MAHASISWA |\n");
printf(" ----------------- \n\n");
printf ("Banyak Data : "); scanf ("%d", &n);
for (i=0;i
clrscr();
printf ("Data ke %d\n", i+1);
printf ("NIM : ");
fflush (stdin);scanf("%s", &biodata[i].nim);
printf ("NAMA : ");
fflush (stdin);scanf("%s", &biodata[i].nama);
printf ("UNIT : ");
fflush (stdin);scanf("%s", &biodata[i].unit);
printf ("SEMESTER : ");
fflush (stdin);scanf("%s", &biodata[i].semester);
}
printf("\n\n");
clrscr ();
printf(" ----------------- \n");
printf(" | DATA MAHASISWA |\n");
printf(" ----------------- \n\n");
printf ("NIM\t\tNAMA\t\tUNIT\tSEMESTER\n\n");
for (i=0;i
printf ("%s\t%s\t %s\t %s\n", biodata[i].nim, biodata[i].nama, biodata[i].unit, biodata[i].semester);
}
getch();
}