samedi 8 septembre 2018

i was trying to create random numbers in an array and then finding the smallest number in that array.how do i modify so that it actually work?

using namespace std;

int one, two, three, four;

int main(){

srand (time(NULL));

one = rand() % 6 + 1;

two = rand() % 6 + 1;

three = rand() % 6 + 1;

four = rand() % 6 + 1;

int myelement [4] = {four, three, two, one};

cout << myelement, myelement[+4] << endl;

cout << min_element(myelement, myelement[+4]);

return 0;

}




Aucun commentaire:

Enregistrer un commentaire