Salut! i am a newbie in c++ programming and as a beginner i am in trouble..i wrote a simple program in c++ for adding 2 numbers:
what's wrong with that code..? i am using Dev C++ v4 compiler.when i debug it, it show me no errors but when i execute it, first ask me for the 2 numbers and then terminated without the result..any help??Code:#include <iostream> int main() { int n1, n2, sum; sum = n1 + n2; cout << "Give the first number:" << endl; cin >> n1; cout << "Give the second number:" << endl; cin >> n2; cout << "The result is...:" sum; return 0; }



LinkBack URL
About LinkBacks
i wrote a simple program in c++ for adding 2 numbers:


