#include using namespace std; //This is a simple demo program to show how to do //basic I/O, use variables, use conditionals, maybe do //some math. int main() { //This symbol means the words folowing are comments. //comments are not compiled. //The cout command is how we print stuff //to the screen. cout << "What I type here will print to the screen!"; cout << endl; //Oh, and the endl thing puts a carriage return in. cout << "Here is a second sentence to print!" << endl; //Declaring an integer variable. //A variable holds some value and can be changed or used. int x; x = 7; cout << "The number in that variable is: " << endl; cout << x; x = x + 21; cout << "Now the variable has value " << endl; cout << x << endl; //should now have value 28 //Write a program that asks for two numbers, and //reports what the product of those two numbers is. //Step 0: Declare variables needed to solve problem int num1; int num2; int answer; //Step 1: Ask user to enter a first number cout << "Hey loser, enter a first number: " << endl; //Step 2: Get their input number, store in num1 variable cin >> num1; //Step 3: Ask user to enter a second number cout << "PLEEEEAAASSSE enter a 2nd number or this proram will never finish.." << endl; //Step 4: Get that 2nd number, store in variable num2 cin >> num2; //Step 5: multiply num1 and num2, could store that new product in answer variable answer = num1 * num2; //Step 6: print out the answer. cout << "So, you entered: " << endl; cout << num1 << " for your first number"<< endl; cout << "And you entered " << num2 << " for your second number..." << endl; cout << "FINAL ANSWER!!!!!! is: " << answer << endl; return 0; }