I did it!

--Originally published at my programming blog

When the teacher explained us the homework WSQ01 I was scared, I didn’t even know how to run the “Hello World” program, but right now I’m really proud of myself! It wasn’t as hard as I thought it would be, I read all chapter 2 of the book and it explains very well, also I read a post in the webpage cplusplus.com that also helped me. So thanks to this I understood how to do the program!

screen-shot-2017-01-18-at-5-01-45-pm

So what I did was:

  1. I typed the basic things like” #include <iostream>”, “using namespace std;” and “int main ()”
  2. Then I put an integer with the values of a and b
  3. Then I typed “cout<< ” First integer: “<<endl;
  4. Then typed “cin>> a; ” (“cin” means that you insert the value you want)
  5. The I typed “cout<< “Second integer: “<< endl;
  6. Again I typed “cin>> b;” ( but this time I entered the b value)
  7. And then I just typed “cout<< “Sum of the two numbers: ” << a+b << endl; (after the string I put operation I wanted which was the sum a+b)
  8. And I did the same with the different operations (difference, division and the remainder)

screen-shot-2017-01-18-at-5-00-09-pm

Here is my program:

#include <iostream>
using namespace std;
int main()
{
int a, b;
cout << “First integer: ” << endl;
cin >> a;
cout << “Second integer: ” << endl;
cin >> b;
cout << “Sum of the two numbers: ” << a+b << endl;
cout << “Difference of the two numbers: ” << a-b<< endl;
cout << “Integer based division of the two numbers: ” << a/b << endl;
cout << “Remainder of the integer division of the two numbers: ” << a%b << endl;
return 0;
}

Thanks for reading!