cin won't respond 2 entr

i've written a couple of XTREMELY simple programs, like addin 2 ints, comparin 2 ints n...
the prompt comes on n i type a number but no matter how many times i press enter my program won't go 2 da nxt step! it's just stuck on that first statement
wat can i do? wat's wrong?!
You've made a mistake in your code. You need to find it and fix it.

Also, the word "what" takes an "h" after the "w".
Last edited on
closed account (zb0S216C)
Code? Note that we will not give full solutions to your problem. We will only point you in the right direction. That way, you learn about the mistake you made and you know how to prevent it the next time you start a project.
it's a sample code off deitel, so i'm pretty sure, there's nothin wrong w/ the code
i usu use Qt as my IDE but i've also tried this code in VS 2010 xpress
still nothin happens when i press entr

// Addition program.
#include <QtCore/QCoreApplication>
#include <iostream>
// function main begins program execution
int main(int argc, char *argv[])
{
int integer1; // first number to be input by user
int integer2; // second number to be input by user
int sum; // variable in which sum will be stored

std::cout << "Enter first number\n"; // prompt
std::cin >> integer1; // read an integer

std::cout << "Enter second number\n"; // prompt
std::cin >> integer2; // read an integer

sum = integer1 + integer2; //assign result to sum

std::cout << "Sum is" << sum << std::endl; // print sum
QCoreApplication a(argc, argv);
return 0; // indicate that program ended successfully
return a.exec();
} // end function main
Topic archived. No new replies allowed.