I am learning C++ and I am using cin >> in online editors because I can’t download an IDE at other places. Here is my problem:
- Whenever I use cin >>, it shows a garbage value instead of like input
- Try this code in any online editor and it will show garbage instead of input
#include <iostream>
using namespace std;
int main(){
cout << "Enter values for x and y: "
double x;
double y;
cin >> x >> y;
cout << x + y;
return 0;
}
- If I made mistakes in my code, please let me know.
- If you find a solution please tell me.
Thank you.