Program C++ Menentukan Nilai Minimum sebuah nilai Array.

Semoga bermanfaat :D


#include<iostream>
using namespace std;
main()
{
int nilai[100];
int i,inp,max,min;
cout<<"http://steroscience.blogspot.co.id/2011/12/include-main-int-nilai100-int.html"<<endl;
cout<<" Masukkan Banyak Inputan : "; cin>>inp;
cout<<"\n";
max=-1000;
min=1000;
for(i=0; i<=inp; i++)
    {
    cout<<" Nilai Ke- "<<i<<" : ";
    cin>>nilai[i];
    }

cout<<"\n";
for(i=0; i<=inp; i++)

if(nilai[i]<min)
        min=nilai[i];

cout<<" Nilai Minimum = "<<min;
cout<<"\n";
return 0;
}



Output:




Subscribe for latest Apps and Games


0 komentar:

Post a Comment