0
#include "StdAfx.h"
#include <iostream>
using namespace std;

int main();
{
    cout << "7 + 3 = " << 7 + 3 << end1;
    cout << "7 - 3 = " << 7 - 3 << end1;
    cout << "7 * 3 = " << 7 * 3 << end1;

    return 0;
}

I get the c2447 error and idk how to fix it. Please help =)

Edited by Nick Evan: Fixed formatting

3
Contributors
7
Replies
8
Views
6 Years
Discussion Span
Last Post by Zvjezdan23
1
#include <iostream>

using namespace std;

int main()
{

	cout << "7 + 3 = " << 7 + 3 << endl;
	cout << "7 - 3 = " << 7 - 3 << endl;
	cout << "7 * 3 = " << 7 * 3 << endl;

	return 0;
}

Here is the corrected code. It is endl (letter l, Not 1

Also, there is no ; after main().

Votes + Comments
Thank you! You helped me a lot
0

Well, you can use a function to get a character from the keyboard. say getchar(). So, it stays till you press a key.

Edited by myk45: n/a

0

try compiling the program without including StdAfx , i think it isnt needed here

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.