I keep getting an error

i keep getting this: ' "c:\Users\Mariana\source\repos\Project3\Debug\Project3.exe" ' is not recognizable as an internal or external command, operable program or batch file. Press any key to continue...


this is my code:
// Project3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>


using namespace std;

main()
{
int choice;
double a, b, out;

// taking user input for choice
cout << "Enter" << endl;
cout << "1 for addition" << endl;
cout << "2 for subtraction" << endl;
cout << "3 for multiplication" << endl;
cout << "4 for division" << endl;
cin >> choice;

// taking user input of 2 numbers
cout << "Enter first number: ";
cin >> a;
cout << "Enter second number: ";
cin >> b;

// with respective to choice performing arithmetic operations
if (choice == 1)
{
cout << a << "+" << b << " = " << a + b << endl;
}
else if (choice == 2)
{
cout << a << "-" << b << " = " << a - b << endl;
}
else if (choice == 3)
{
cout << a << "*" << b << " = " << a*b << endl;
}
else if (choice == 4)
{
if (b == 0)
cout << "Division is not possible with 0";
else
cout << a << "/" << b << " = " << a / b << endl;
}
else
{
cout << "Invalid choice";
}
}
/*

Even with the simple "Hello World" i get a similar error. It's starting to get really frustrating...please help!
this is telling you that the operating system cannot find the executable program (the .exe file).
This happens if you try to run the program from a place where windows cant 'see' it --- most often if trying to run it from a console window.

try going to that folder and running it from there.

it can also happen if the program did not compile, and you tried to run it but the .exe file does not actually exist because it did not compile...
Last edited on
you need to add int in front of main()
It seems you are using Visual Studio.
Do you try to run it from inside the IDE or from the console.
If you try to build it what is the output?
Topic archived. No new replies allowed.