#include <cstdlib>
#include <iostream>
using namespace std;
void CariElemenTerbesar(int a[], int &maks){
int k,n;
maks = a[0];
n = sizeof (a);
for(k=2;k<=n;k++){
if (a[k] > maks){
maks = a[k];
}
}
}
int main(int argc, char *argv[])
{
int maks;
int a[]={7,6,13,10,8,9};
CariElemenTerbesar(a,maks);
cout<<endl<<maks<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
void CariElemenTerbesar(int a[], int &maks){
int k,n;
maks = a[0];
n = sizeof (a);
for(k=2;k<=n;k++){
if (a[k] > maks){
maks = a[k];
}
}
}
int main(int argc, char *argv[])
{
int maks;
int a[]={7,6,13,10,8,9};
CariElemenTerbesar(a,maks);
cout<<endl<<maks<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
No comments:
Post a Comment