BUATLAH FUNGSI YANG MENENTUKAN NILAI TERBESAR DARI 2 BILANGAN BULAT
PROGRAM
#include <iostream>
#include <conio.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void Nilbes(int a, int b)
{ a>b ;}
main(){
int a,b;
cout<<"Menetukan nilai terbesar"<<endl;
cout<<"masukkan nilai 1 : "; cin>>a;
cout<<"masukkan nilai 2 : "; cin>>b;
if(a>b)
cout<<"nilai terbesar : "<<a<<endl;
else
cout<<"nilai terbesar : "<<b<<endl;
getch ();
}

PROGRAM
#include <iostream>
#include <conio.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void Nilbes(int a, int b)
{ a>b ;}
main(){
int a,b;
cout<<"Menetukan nilai terbesar"<<endl;
cout<<"masukkan nilai 1 : "; cin>>a;
cout<<"masukkan nilai 2 : "; cin>>b;
if(a>b)
cout<<"nilai terbesar : "<<a<<endl;
else
cout<<"nilai terbesar : "<<b<<endl;
getch ();
}
0 ulasan