langsung saja dibawah ini adalah contoh function pada
bahasa c/c++.
Source
code :
#include
<iostream.h>
#include
<conio.h>
void
garis();
void
main()
{
clrscr();
garis();
cout<<"NIM NAMA-NAMA MAHASISWA STIKOM
MEDAN"<<endl;
garis();
cout<<"14221026 RICHARD NAINGGOLAN "<<endl;
cout<<"14221027 ANRI IRVAN GIRSANG" <<endl;
cout<<"14221028 JOHAN BAGINDA PAKPAHAN
"<<endl;
cout<<"14211029 RUSTAM HALAWA" <<endl;
cout<<"14211030 MONA LISA MANIK "<<endl;
cout<<"14221031 WIDYA WULANDARI" <<endl;
cout<<"14221032 HENIATI SIREGAR" <<endl;
cout<<"14221033 DAHLIA GAJAH" <<endl;
cout<<"14221034 EKA SINAGA" <<endl;
cout<<"14221035 DIGO SIBARANI" <<endl;
cout<<"14221036 JOHANNES MARTIN" <<endl;
cout<<"14221037 NURUL UTARI" <<endl;
cout<<"14221038 PETRA SIHOMBING" <<endl;
garis();
getch();
}
void
garis()
{
int i;
for (i=0;i<=40;i++)
{
cout<<"--";
}
cout<<endl;
}