Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Basic program shuts down immediately.

$
0
0

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?



Viewing all articles
Browse latest Browse all 5347

Trending Articles