In the last loop you're trying to assign values to members of x, even though x does not contain any elements yet.
You need to use push_back there too.
Edit: you should use the debugger in future (to run the program with the debugger in Code::Blocks, click Debug/Start).
When a segmentation fault occurs, it will show you the problematic line.
To add vector bounds checking in Code::Blocks/g++, go to Project/Build options/#defines and add _GLIBCXX_DEBUG (only for Debug build, of course). Then it will show you the callstack. The line at the bottom with main() is what is of interest to you, it shows that the problem occurred in line 20.
"Create three vector<int> objects and fill the first two as in the previous exercise. Write a for loop that adds each corresponding element in the first two vectors and put the result in the corresponding element of the third vector. Display all three vectors."
I'm not sure I've got it yet but I don't want to go to the next chapter until a fully understand this one.
What Athar is saying is instead of having a loop to populate x, then another to overwrite everything you put in it, why not just directly do x.push_back(v[i]+w[i]);