One small thing, to continue with what Richard did :
struct kelompok kel[] = {
{ "P001", "Alvionina", 18 },
{ "P002", "Stevanny", 18 },
{ "P003", "Joanita", 18 },
{ "P004", "Revan", 18 },
{ "", "", -1 }
};
and instead of padding the names with spaces, change the
print
method in
kelompok
to specify the width in the format string :
void print()
{
printf( "%s | %9s | %d\n", idpegawai, nama, umur );
}
I prefer to avoid printing tabs because they can be problematic.