Yes folks,
I'm new to the forum and c++. I've decided to start learning c++ so I'm well prepared when i enter into a foundation degree course on September. I've chosen c++ primer 5th edition as the book to guide me there (it was between that and Programming: Principles and Practice Using C++). I'm going to do all the exercises in the book being only on exercise 1.4 I've already stumbled upon a problem. The question is
"Exercise 1.4: Our program used the addition operator, +, to add two
numbers. Write a program that uses the multiplication operator, *, to print
the product instead."
The error that im getting is " expected ; before std " on line 6" the first std.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
int main()
{
std::cout << "enter two numbers" std::endl;
int v1 = 0, v2 = 0;
std::cin >> v1 >> v2;
std::cout << "The multiplication of" << v1 << " and " << v2
<< "is " << v1 * v2 << std::endl;
return 0;
}
|
I'll most likely be stumbling upon lots of problems on lots of different exercises throughout the book rather than torturing yous every 5 minutes it would be handier if i knew where the answers were when i can see no problems within the code.
Thanks in advance for anyones help.
Aaron.
EDIT: Gone it fixed, i was missing the second << on the 6th line. Feel so stupid lol. Although it would be still helpful if i could find the answers somewhere for future reference.