Sir how is this code wrong

#include<bits/stdc++.h>
using namespace std;

int main()
{
int a,b,c;
cout << "Enter the value of a:-> " << endl;
cin >> a;
cout << "Enter the value of b:-> " << endl;
cin >> c;
cout << "Enter the value of c:-> " << endl;
cin >> c;
if(a>b && a>c)
{
cout << "Largest number is a which is " << a << endl;
}
else if(b>a && b>c)
{
cout << "Largest number is b which is " << b << endl;
}
else
{
cout << "Largest number is c which is " << c << endl;
}
return 0;
}

The logic error is in reassigning lg to b after checking for a . The second condition compares b with a and c , making the final else block always output c as the largest.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.