Why doesn't this work?
#include <stdafx.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
static int x;
int y;
cout <<"1. view\n2. edit\n";
cin >> y;
if (y==1){
cout <<endl << x <<endl<<endl;
}
if (y==2){
cout <<"Please enter the value of x\n";
cin >> x;
cout << "\nx = "<<x<<endl<<endl;
}
return 0;
}