// simpan dgn nama : prototipe.cpp
#include <conio.h>
#include <iostream.h>
#include <string.h>
char coment(char ket[30],int n); //prototipe fungsi
main()
{
char lagi, c[30];
int i;
atas:
clrscr();
{
cout<<"Masukkan nilai = ";cin>>i;
coment(c,i); //parameter aktual
cout<<c;
cout<<"\n\nIngin input lagi [Y/T]: ";cin>>lagi;
}
if (lagi=='Y' || lagi=='y')
goto atas;
else
getch();
}
char coment(char ket[30],int n)//parameter formal
{
int a;
a=n%2;
if (a==1)
strcpy(ket,"---Bilangan Ganjil---");
else
strcpy(ket,"---Bilangan Genap---");
}
Hasil running
Prototipe
Label:
Materi Borland
0 komentar:
Posting Komentar