Hello World

--Originally published at PZ

So this is my first post in the blog, and I would like to start writing about this exciting first week in Ken class. I think that this is the subject that I most excited to take, at least, during this first semester, because I would like to learn a lot of stuff about programming also because I have really liked the way that Ken introduced us to the class and the topics that he show us, for example, I enjoyed a lot doing my first homework and I really liked that he works with pages like Lynda ( that I didn’t know before). Finally, I would mention that I feel excited about the method that Ken uses in this class in which we have to be responsible to watch the videos, watch Lynda and read the book to approach the goal of this class and be ready for the exams.                                                                                                It was so exciting for me to make Hello Worl which is a very simple program, but that means much more to me because it was my first experience in C++ language, with Atom, bash, etc. And that motivated me to continue learning.

 

Code:

#include <iostream>#include <iostream>using namespace std;
int main() { cout << “Hello World” << endl; return 0;

}


Fun with Numbers

--Originally published at PZ

This was a little bit difficult than Hello World because in this code I had to search in differents blogs and in Youtube about how to do operations like sum, rest, division and multiplication. I searched in Google and I found this blog http://programa-c.blogspot.mx/2010/04/codigos-c-suma-dos-numeros-enteros.html which help me a lot, becuase I used it like the base an then I added product and division.

#include <iostream>
#include <stdlib.h>
using namespace std;

int main(){

int a,b,suma,resta,producto,division=0;

cout<<“\n ingrese numero a:”;

cin>>a;

cout<<“\n ingrese numero b:”;

cin>>b;

suma=a+b;
resta=a-b;
producto=a*b;
division=a/b;

cout<<“\n la suma de “<<a<<“+”<<b<<” es:”<<suma;
cout<<“\n la resta de “<<a<<“-“<<b<<” es:”<<resta;
cout<<“\n el producto de “<<a<<“*”<<b<<” es:”<<producto;
cout<<“\n la division de “<<a<<“/”<<b<<” es:”<<division;

return 0;

 

}

Links

Programa C, Suma de dos números enteros:

http://programa-c.blogspot.mx/2010/04/codigos-c-suma-dos-numeros-enteros.html