Hey i recently wrote a program using variables. The program works fine but when compile nd run the program the variable always comes out as "4370436". Here is the program:
#include <iostream>
int main() {
using namespace std;
int x;
cout << "What is your name";
cin >> x;
cout << "hello " << x;
system("pause");
return 0;
}
when i compile and run it this is the result:
What is your name? Dan
hello 4370436Press any key to continue...
Why is the variable not Dan??! Someone please help!!!