#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int i;
int maks;
int minn;
int x;
int A[100];
A[100] = 0;
i =1;
maks =0;
minn =10000;
raptor_prompt_variable_zzyz ="Masukan X : ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> x;
while (!(i>x))
{
raptor_prompt_variable_zzyz ="Masukan Nilai : ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> A[i];
cout << "Bilangan "<<i<<" : "<<A[i]<< endl;
if (A[i]>maks)
{
maks =A[i];
}
else
{
}
if (A[i]<minn)
{
minn =A[i];
}
else
{
}
i =i+1;
}
cout << "Nilai Maksimum : "<<maks<< endl;
cout << "Nilai Minimum : "<<minn<< endl;
return 0;
}
Raptornya :
Comments
Post a Comment