Console closing to soon.

Apr 2, 2011 at 8:52pm
After I press enter after it says enter second number and I do it automatically closes even though I have system("pause"); and im running windows vista 32-bit.


#include <conio.h>
#include <Windows.h>
#include <string>
#include <iostream>

using namespace std;

int main(){
int firstnum, secondnum, answer;
cout << "Hey" << " Dudes" << " Whatsup?" << endl;
cout << "Enter first number: ";
cin >> firstnum;
system("cls");
cout << "Thanks dude." << endl;
cout << "Now enter second number: ";
cin >> secondnum;
system("cls");
answer = firstnum + secondnum;
cout << "The addition of those numbers is: " << answer;
cout << endl << endl << endl;
system("pause");
}
Apr 2, 2011 at 11:38pm
Apr 3, 2011 at 7:49pm
What is that supposed to do.
Apr 3, 2011 at 7:51pm
@ ty98: Please be more specific in your question, are you asking what the link that ciphermagi posted is supposed to accomplish? Or are you asking the OP what they are trying to do?
Apr 3, 2011 at 11:01pm
No the cop. That snowborder7 posted!!!!!!!
Apr 4, 2011 at 12:38am
No the cop. That snowborder7 posted!!!!!!!


What? What do you mean by "the cop".
Apr 4, 2011 at 12:45am
@ty98:

The point of the (almost illegible without [code][/code] brackets) program is to accept 2 integers from the user, and print the sum of the input.
Topic archived. No new replies allowed.