#include <iostream.h>
#include <conio.h>
void main ()
{
float a, b, c, sum, product, average;
cout<<"Nilai a = ";
cin>>a;
cout<<"Nilai b = ";
cin>>b;
cout<<"Nilai c = ";
cin>>c;
sum = a + b + c;
cout<<"\n1. Sum = "<<sum<<endl;
product = a * b * c;
cout<<"\n2. Product = "<<product<<endl;
average = ( a + b + c ) / 3;
cout<<"\n3. Average = "<<average<<endl;
if ( a > b && a > c )
cout<<"\n4. Largest = " <<a;
if ( b > a && b > c )
cout<<"\n4. Largest = " <<b;
if ( c > a && c > b )
cout<<"\n4. Largest = " <<c;
else
cout<<"\nNB. LARGEST & SMALLEST = ANGKA SAMA. TIDAK ADA YANG TERBESAR MAUPUN TERKECIL ";
if ( a < b && a < c )
cout<<"\n\n5. Smallest = " <<a;
if ( b < a && b < c )
cout<<"\n\n5. Smallest = " <<b;
if ( c < a && c < b )
cout<<"\n\n5. Smallest = " <<c;
}
No comments:
Post a Comment