Where do I enter a promotional code on national express?

Microsoft visual c++ 2010 express how to i fix - Error: identifier "cout" is undefined?

  • i have recently started programing using microsoft visual c++ 2010 express and the error "Error: identifier "cout" is undefined" keeps coming up when ever i type cout or cin . also it worked before when i made a simple calculator but it wont work now here is the code : // project1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <vector> #include <string> using namespace std; int main () { double num1 , num2 , result,; int choose; cout << " enter number 1"; cin >> num1; cout << "enter number 2"; cin >> num2; cout << "1. add 2.subtract 3.divide 4.multiply: "; cin >> choose; if (choose == 1) result = num1 + num2; else if (choose == 2) result = num1 - num2; else if (choose == 3) result = num1 / num2; else if (choose ==4) result == num1 * num2; cout << "your result is: " << result << endl; return 0; }

  • Answer:

    Add #include <iostream> a the beginning and it should fix it.

Jake at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.