#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 =)

Recommended Answers

#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; …
Jump to Post

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

Jump to Post

All 7 Replies

#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().

commented: Thank you! You helped me a lot +0

Cool, thank you =) How can I make my debug window stay there for a little longer??

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

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

Where do i put getchar()

Where do i put getchar()

use it before return statement

commented: thx for your help =) +0

Cool thx man =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.