Just started learning some C++ from Yt and no idea what is going on here.

C/C++

So I started learning C++ like a week ago and was just trying to make a random code for the sake of practice but idk what is going on here. Like, when I assign values to the variables within the code, the calculations are correct but the moment I ask it to take an input, even if the input values are the same, it gives me some nonsensical result.

Maybe my basics are not clear ? I am trying to learn by myself as I don't really have the means of joining an actual class, if anyone could explain what I am doing wrong, thank you.

If I let it take inputs

If I add the values into the code

Posted Dec 13, 2025, 10:23 AM UTC

05
Loading comments…