Assume that the vector v exists Use a for loop to find the l

Assume that the vector v exists. Use a for loop to find the largest element in v and store the result in the variable r

Solution

Answer:

int r= 0;

for(int i=0; i<v.size(); i++){

if(r< v[i]){

r= v[i];

}

}

cout<<\"Largest element in v is \"<<r<<endl;

Assume that the vector v exists. Use a for loop to find the largest element in v and store the result in the variable rSolutionAnswer: int r= 0; for(int i=0; i&

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site