Comparison with ifs always entering the first

1

I'm trying to make comparison using if, but it always goes in the first if:

 if((vetor[0] << vetor[1]) && (vetor [0] << vetor [2]) && (vetor [0] << vetor [3])){
    cout << "\n" << vetor [0] << "\n eh o menor \n"; }

    else if((vetor [1] << vetor [2]) && (vetor [1] << vetor [3])){
    cout << "\n" << vetor [1] << "\n eh o menor \n"; }

    else if ((vetor[2] << vetor[1]) && (vetor [2] << vetor [3])){
    cout << "\n" << vetor [2] << "\n eh o menor \n"; }

    else if ((vetor[3] << vetor[1]) && (vetor [3] << vetor [2])){
    cout << "\n" << vetor [3] << "\n eh o menor \n"; }
    
asked by anonymous 12.11.2016 / 18:00

1 answer

2

<< and >> are not comparators

Change << by < , and >> by > .

    
12.11.2016 / 18:07