This post left anonymously
What is wrong with this C++ program?
Why does it crash before it loads?
// Fig. 2.5: fig02_05.cpp
// Addition program that displays the sum of two integers.
#include iostream> // allows program to perform input and output
// function main begins program execution
int main()
{
// variable declarations
int number1; // first integer to add
int number2; // second integer to add
int sum; // sum of number1 and number2
std::cout “Enter first integer: “; // prompt user for data
std::cin >> number1; // read first integer from user into number1
std::cout “Enter second integer: “; // prompt user for data
std::cin >> number2; // read second integer from user into number2
sum = number1 + number2; // add the numbers; store result in sum
std::cout “Sum is ” sum std::endl; // display sum; end line
return 0; // indicate that program ended successfully
} // end function main
This open post was written 1 year ago | V/U/S: 85, 1, 2 | Edit Post | Leave a reply | Report Post
Reciprocity (0)
Since writing this post Anonymous may have helped people, but has not within the last 4 days.
Invite Others to Help
A logged in and verified Help.com member has the ability to setup a Friends List and invite others to help with posts.