locked
Basic program shuts down immediately. RRS feed

  • Question

  • I'm learning C++ and this is my code:

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


    int main()
    {
    std::cout << "Enter two numbers" << std::endl;
    int v1 = 0, v2 = 0;
    std::cin >> v1 >> v2;
    std::cout << "The sum of " << v1 << " and " << v2 << " is " << v1 + v2 << std::endl;

        return 0;
    }

    It shutdowns when I enter two numbers, but I want it to stay open.

    Can anyone help me?


    Friday, August 7, 2015 8:29 PM

Answers