Can swimming help reduce body fat and tone ab muscles?

Swimming: This exercise  might not be in first place if you going for weight reduction but it can No other exercise or workout burns more calories , boost body metabolism and maximizes the amount of oxygen in your blood.
An easy swim burns around 500 calories an hour, while a vigorous effort can reach up to 700 calories an hour
Swimming exercise provided workout for lower body, upper body, core, and back will all be worked and strengthen during a good swimming workout, you can go for 4 to 6 days swimming workout

Swimming helps in toning lower abs and helps in cutting down extra pounds of fat.
Do people who go to the gym follow a routine?

Yes most do.There are too many approaches to list here but for example I do strength training so my routine is Chest, Arms, Legs and then Back.  This way when I cycle back to the same body part it is repaired.  I also do cardio on certain days for about 40 minutes. 

Are there any mental exercises to make your brain smarter?

Brain is the centre of all learning and experiences and cognitive skills are the core skills required to process the information. Cognitive skills like Memory, Logical Thinking, Attention Span, Learning Ability are critical to performing any task, simple or complex. Cognition requires multiple areas

I already know C and Java. Could you recommend me some resources to learn C++?

visit the link below to download itC++ in One Hour a Day, Sams Teach Yourself (8th Edition)In just one hour a day, you'll have all the skills you need to begin programming in C++. With this complete tutorial, you'll quickly master the basics,