Sabtu, 16 Desember 2017

PROGRAM MENGINPUT DATA MAHASISWA

berikut adalah program penginputan data mahasiswa dengan menggunakan Dev C++

Source code :

#include <conio.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
int main ()
{system("title PEMROGRAMAN C++ ");
struct data_mahasiswa
{char nim [50], unit [60], nama[100], semester[10];};
int i, n;struct data_mahasiswa biodata[20];
printf("================================================================\n");
printf("=================PROGRAM MARKLIST DATA MAHASISWA================\n");
printf("================================================================\n");
printf ("Banyak Data : "); scanf ("%d", &n);for (i=0;i<n;i++){
printf ("========================PENGINPUTAN DATA========================\n");
printf ("Data ke %d\n", i+1);printf ("NIM: ");
scanf("%s", &biodata[i].nim);printf ("NAMA: ");
scanf("%s", &biodata[i].nama);printf ("JURUSAN: ");
scanf("%s", &biodata[i].unit);printf ("SEMESTER: ");
scanf("%s", &biodata[i].semester);}printf("\n\n");
printf("================================================================\n");
printf("-------------------------DATA MAHASISWA-------------------------\n");
printf("================================================================\n\n");
printf("|| NIM\t\t| NAMA\t\t|\ JURUSAN\t|\tSEMESTER||\n");
printf("==================================================================\n");
for (i=0;i<n;i++){printf ("|| %s\t| %s\t\t| %s\t\t|\t%s\t||\n",
biodata[i].nim, biodata[i].nama, biodata[i].unit, biodata[i].semester);}

getch();}


Output:


Tidak ada komentar:

Posting Komentar