Help a Beginner!

Hey I use C++ in "Microsoft Visual Studio 2013".
I enter two numbers.
I wanna sum and multiply this two numbers.

Where is the problem?

My code:

#include <iostream>
#include <conio.h>


using namespace std;


int main()
{
int Zahl1, Zahl2, Summe, Produkt;

cout << "Geben Sie die erste Zahl ein!" endl;
cin >> Zahl1;

cout << "Geben Sie die zweite Zahl ein!" endl;
cin >> Zahl2;

Summe = Zahl1 + Zahl2;
Produkt = Zahl1 * Zahl2;

cout << Zahl1 << "+" << Zahl2 << "=" << Summe << endl;
cout << Zahl1 << "*" << Zahl2 << "=" << Produkt << endl;

return 0;

}
You are missing << before the endl; in cout << "Geben Sie die erste Zahl ein!" endl; and
cout << "Geben Sie die zweite Zahl ein!" endl;

For example

 
cout << "Geben Sie die zweite Zahl ein!" << endl;
Last edited on
Thank you!!
I am also a beginner and i got an assignment to create a program that is suposed to write :

This (") is a quote, and this (\) is a backslash

I got it to print Hello World and other statements but not the above statement

Here is what i have done so far:

#include <iostream>

using namespace std;

int main()

{

cout << "hello world" <<endl;
cout << "This (") a quote, and this (\) is a backslash" << endl;
return 0;
}

Topic archived. No new replies allowed.